-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom variables in settings.json for easier profile configuration #9185
Comments
This isn't a terrible idea, but I'm guessing that this would not play well with the Settings UI. So this would end up being a feature that would work well if you exclusively used the json settings. I'm gonna stick this in the freezer for now. It's a reasonable request, but not one we're likely to get to anytime soon. |
This is dearly required feature for our company now, please take it out the freezer I have 100s of servers we manage using Windows Terminal {
"colorScheme": "Raspberry",
"commandline": "pwsh.exe -c ssh [email protected]",
"font":
{
"size": 10
},
"guid": "{5f1b74da-9684-591d-8a8a-bed6171bd000}",
"hidden": false,
"icon": "C:\\Scripts\\windows-terminal-icons\\icons\\ubuntu.png",
"name": "server-01"
}, Now every time we have a new desk agent or employee in the IT team who needs this file we have to copy to his machine and replace Then as we are big enterprise when this file changes because we have added and removed terminal profiles we have to update everyone and its becoming a massive unpleasant time wasting chore. How can we define at the top of the settings.json an variable for example sshusername=myusername? and then have each profile {
"colorScheme": "Raspberry",
"commandline": "pwsh.exe -c ssh ${sshusername}@server-01.domain.net",
"font":
{
"size": 10
},
"guid": "{5f1b74da-9684-591d-8a8a-bed6171bd000}",
"hidden": false,
"icon": "C:\\Scripts\\windows-terminal-icons\\icons\\ubuntu.png",
"name": "server-01"
}, This way we could push the settings json file via policy to all the machines and have near zero maintenance. |
You may not be able to achieve exactly this today, but... it seems much better-served by:
This at least prevents you from having to override everyone's settings every time you provision a new server. Plus,
(as an aside: why are you launching PowerShell just to launch |
I am glad you asked my example above is not entirely exactly what we are doing (some sensitive parts has been removed). But since I think this should be Okay to share in this way. Currently I have set an environment variable some others as well which is SSHADMIN and that is set to my admin username |
Oh! I get it. I think ( |
Description of the new feature/enhancement
Let one define custom variables in settings.json for use with profiles.
E.g. define myCustomVariable for later use within commandline to avoid adding same long path to SSH key file for every profile name.
Would also be great to reuse current profile parameters such as "name" to connect to this hostname by stating $profile.name with SSH as shown in example.
Proposed technical implementation details (optional)
The text was updated successfully, but these errors were encountered: