microsoft / microsoft/terminal

Extension: Ask for parameter for profile

Open
#8,339 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Extensibility Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points, so begin by locating profile activation and command-line parameter handling in the repository. Done means prompting once for each distinct parameter when the profile opens, substituting values in the command line and tab name, and preserving normal profiles without parameters.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.