Skip to content
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

Open
bakutheleo opened this issue Nov 20, 2020 · 6 comments
Open

Extension: Ask for parameter for profile #8339

bakutheleo opened this issue Nov 20, 2020 · 6 comments
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@bakutheleo
Copy link

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.

@bakutheleo bakutheleo added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 20, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 20, 2020
@DHowett DHowett changed the title Ask for parameter for profile Extension: Ask for parameter for profile Nov 20, 2020
@DHowett
Copy link
Member

DHowett commented Nov 20, 2020

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.

@DHowett DHowett added this to the Terminal Backlog milestone Nov 20, 2020
@DHowett DHowett added Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Product-Terminal The new Windows Terminal. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Nov 20, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Nov 20, 2020
@zadjii-msft
Copy link
Member

As an intermediary, you might have success with the commandline mode of the command palette. With that, you could type something like nt ssh user@serverName, and that'll open a new tab in the current window running ssh user@serverName.

@bakutheleo
Copy link
Author

Thanks, good idea! I thought of done something like that but hadn't looked into it enough. Good workaround for now.

@bakutheleo
Copy link
Author

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."

@zadjii-msft
Copy link
Member

Sorry, that's my bad. To get to commandline mode, you have to delete the leading > (on 1.5), or type a leading > (on 1.4). I know that's confusing, we just recently changed that to align with VsCode. See #7935

@bakutheleo
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

3 participants