-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Extension: Ask for parameter for profile #8339
Comments
Hey, this is a cool idea! Thanks! It's not something we're likely to do on our own, but I'm going to mark it up as a possible future extension. We're collecting these in #4000 to gauge what our plugin plan should encompass. |
As an intermediary, you might have success with the commandline mode of the command palette. With that, you could type something like |
Thanks, good idea! I thought of done something like that but hadn't looked into it enough. Good workaround for now. |
I must be missing something...I don't see a way to start an arbitrary executable that way. If I don't specify a specific profile it just says "No matching commands." |
Sorry, that's my bad. To get to commandline mode, you have to delete the leading |
Got it, thanks, that was it! Keeps the current tab label, which is a little wierd. I know I can change that in the command. |
Description of the new feature/enhancement
I often have the need for multiple, but similar tabs. For example, an SSH terminal to various servers. Currently, afaik, I must create a new profile for each that specifies the specific server I want to connect to. This is not generally practical, as I have a large number of servers and may need to connect to any of them at any time. Currently I have to edit the profile entry in the config file with the new server name--thankfully that is read immediately so I can then use that profile, but this is still cumbersome.
Proposed technical implementation details (optional)
I would like to be able to specify a variable name in a profile that would request the value when I open that profile. For example, current a static entry for an ssh profile would be:
"commandline": "ssh user@servername"
It would be useful to be able to have a parameter so the value were requested from the user:
"commandline": "ssh user@%Server name%"
or multiple parameters:
"commandline": "ssh %user%@%Server name%"
When this profile is activated wt would ask the user for each parameter. This way I could have one profile that could handle whatever machine I want to connect to. Every time I open a new tab using this profile it would ask for the parameters to use in that tab. In my first example it would raise a dialog requesting Server name where I would enter the name of the server I want to connect to. In the second example it would also ask for the user. Of course this could be used for any purpose or other value.
I further suggest that if the same parameter name is used more than once it would only ask once, but use that for each reference. This would allow, for example, to use that parameter in the tab name:
"name": "SSS (%Server name%)",
"commandline": "ssh user@%Server name%"
In this example wt would ask for the value of "Server name" once, then use it in the tab title as well as the connection.
The text was updated successfully, but these errors were encountered: