command palette should recognize profiles directly #12608

Closed
opened 2026-01-31 03:20:08 +00:00 by claunia · 11 comments
Owner

Originally created by @ffes on GitHub (Feb 15, 2021).

Description of the new feature/enhancement

Right now it is too difficult to open a new tab with a specific profile using the command palette. These are currently the keystrokes, you need to type:

  • Ctrl+Shift+P
  • .. (the "New Tab..." item is now selected, which luckily happened to be alphabetically the top item for that search string)
  • Enter to activate that "New Tab" command.

At this point you get a list of the profiles, that you can select and open.

For me, this is too cumbersome, so to open a new tab a non-current profile I always use the mouse and never use the command palette. The "New Tab, profile index: X" entries don't really help either. I can't remember what number is what profile on what machine. And since all the entries with the names of the profiles are in nested/submenus there is no way that typing a part of the profile name would show them in the command palette.

The command palette should help me, to do the common tasks quickly and opening a new tab with a certain profile is my most used task. On a normal day I have at least 3 tabs open from different profiles (Ubuntu, Git Bash, VS 2019 Developer CMD)

In the ideal world, I would press Ctrl+Shift+P, type a part of the profile name and the "New Tab" of that profile would be the first entry shown, the three "split pane" entries would be underneath that.

Disclaimer: I can't imagine this hasn't been requested before. I searched the issues, but couldn't find any issue. I probably missed some keywords while searching.

Originally created by @ffes on GitHub (Feb 15, 2021). # Description of the new feature/enhancement Right now it is too difficult to open a new tab with a specific profile using the command palette. These are currently the keystrokes, you need to type: - `Ctrl+Shift+P` - `..` (the "New Tab..." item is now selected, which luckily happened to be alphabetically the top item for that search string) - `Enter` to activate that "New Tab" command. At this point you get a list of the profiles, that you can select and open. For me, this is too cumbersome, so to open a new tab a non-current profile I always use the mouse and never use the command palette. The "New Tab, profile index: X" entries don't really help either. I can't remember what number is what profile on what machine. And since all the entries with the names of the profiles are in nested/submenus there is no way that typing a part of the profile name would show them in the command palette. The command palette should help me, to do the common tasks quickly and opening a new tab with a certain profile is my most used task. On a normal day I have at least 3 tabs open from different profiles (Ubuntu, Git Bash, VS 2019 Developer CMD) In the ideal world, I would press `Ctrl+Shift+P`, type a part of the profile name and the "New Tab" of that profile would be the first entry shown, the three "split pane" entries would be underneath that. _Disclaimer_: I can't imagine this hasn't been requested before. I searched the issues, but couldn't find any issue. I probably missed some keywords while searching.
Author
Owner

@skyline75489 commented on GitHub (Feb 16, 2021):

I think we have a fuzzy-search request somewhere but it might not be what you expect.

Generally I think this is a good idea.

@skyline75489 commented on GitHub (Feb 16, 2021): I think we have a fuzzy-search request somewhere but it might not be what you expect. Generally I think this is a good idea.
Author
Owner

@zadjii-msft commented on GitHub (Feb 16, 2021):

So we actually explicitly decided not to have the profiles pollute the top level of the command palette by default. Some users might just have a lot of profiles, and if we're adding top level "new tab" actions for each profile, should we also add actions for "split pane" with each profile? It just made more sense to group the commands by the action first, then nest the profiles under that.

That being said, you can totally customize how the command palette is laid out. Right now we're building the "New Tab... > [profiles]" entries with the following:


        {
            // New tab...
            "name": { "key": "NewTabParentCommandName" },
            "commands": [
                {
                    "iterateOn": "profiles",
                    "icon": "${profile.icon}",
                    "name": "${profile.name}",
                    "command": { "action": "newTab", "profile": "${profile.name}" }
                }
            ]
        },

That's what creates the nested entries. If you wanted to add the profiles as a top-level entry, you could instead add the following:

{
    "iterateOn": "profiles",
    "icon": "${profile.icon}",
    "name": "New tab with profile: ${profile.name}",
    "command": { "action": "newTab", "profile": "${profile.name}" }
}

Is that more what you're looking for?

@zadjii-msft commented on GitHub (Feb 16, 2021): So we actually explicitly decided not to have the profiles pollute the top level of the command palette by default. Some users might just have a _lot_ of profiles, and if we're adding top level "new tab" actions for each profile, should we also add actions for "split pane" with each profile? It just made more sense to group the commands by the action first, then nest the profiles under that. That being said, you can totally customize how the command palette is laid out. Right now we're building the "New Tab... > [profiles]" entries with the following: ```jsonc { // New tab... "name": { "key": "NewTabParentCommandName" }, "commands": [ { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "${profile.name}", "command": { "action": "newTab", "profile": "${profile.name}" } } ] }, ``` That's what creates the nested entries. If you wanted to add the profiles as a top-level entry, you could instead add the following: ```json { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "New tab with profile: ${profile.name}", "command": { "action": "newTab", "profile": "${profile.name}" } } ``` Is that more what you're looking for?
Author
Owner

@ffes commented on GitHub (Feb 16, 2021):

So we actually explicitly decided not to have the profiles pollute the top level of the command palette by default.

Not sure why it would pollute the command palette. When you start to type it shortens very quickly to the entries that match your query. VS Code has way more commands (especially with extensions installed) and their command palette works great.

But since you said this was the decision the team made, I guess we'll have to live with it. Thankfully you made it configurable. I was unaware of that.

If you wanted to add the profiles as a top-level entry, you could instead add the following

That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me!

IMHO this should be the default (let's agree to disagree 😉), at least mentioned in the docs. I'm considering adding this to the docs myself, but English is not my native language, so I'll have to see how far I will get with that.

@ffes commented on GitHub (Feb 16, 2021): > So we actually explicitly decided not to have the profiles pollute the top level of the command palette by default. Not sure why it would pollute the command palette. When you start to type it shortens very quickly to the entries that match your query. VS Code has way more commands (especially with extensions installed) and their command palette works great. But since you said this was the decision the team made, I guess we'll have to live with it. Thankfully you made it configurable. I was unaware of that. > If you wanted to add the profiles as a top-level entry, you could instead add the following That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me! IMHO this should be the default (let's agree to disagree :wink:), at least mentioned in the docs. I'm considering adding this to the docs myself, but English is not my native language, so I'll have to see how far I will get with that.
Author
Owner

@zadjii-msft commented on GitHub (Feb 18, 2021):

Okay great! Glad I could help. Theoretically this could be added as a tutorial on the docs site, so I'll file a follow up on the docs rep for that.

@zadjii-msft commented on GitHub (Feb 18, 2021): Okay great! Glad I could help. Theoretically this could be added as a tutorial on the docs site, so I'll file a follow up on the docs rep for that.
Author
Owner

@schuebel commented on GitHub (Jun 1, 2021):

Is there a way to assign a shortcut that directly opens the "New Tab..." menu? Adding "keys": "ctrl+alt+t" in the settings.json did not seem to work.

{
   // New tab...
   "name": { "key": "NewTabParentCommandName" },
   "commands": [
       {
           "iterateOn": "profiles",
           "icon": "${profile.icon}",
           "name": "${profile.name}",
           "command": { "action": "newTab", "profile": "${profile.name}" }
       }
   ],
   "keys": "ctrl+alt+t"
},

@schuebel commented on GitHub (Jun 1, 2021): Is there a way to assign a shortcut that directly opens the "New Tab..." menu? Adding "keys": "ctrl+alt+t" in the settings.json did not seem to work. ``` { // New tab... "name": { "key": "NewTabParentCommandName" }, "commands": [ { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "${profile.name}", "command": { "action": "newTab", "profile": "${profile.name}" } } ], "keys": "ctrl+alt+t" }, ```
Author
Owner

@BWWIT commented on GitHub (Mar 20, 2024):

That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me!

@zadjii-msft: Will you share your settings element(s)? :-)

@BWWIT commented on GitHub (Mar 20, 2024): > That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me! > @zadjii-msft: Will you share your settings element(s)? :-)
Author
Owner

@zadjii-msft commented on GitHub (Mar 20, 2024):

Sorry, which elements are you looking for?

@zadjii-msft commented on GitHub (Mar 20, 2024): Sorry, which elements are you looking for?
Author
Owner

@BWWIT commented on GitHub (Mar 20, 2024):

Ups, wrong tagging, it should have been "ffes", sorry.
But he wrote above
"That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me!"
I assume he's talking about some elements in the json-settings-file he made.

@BWWIT commented on GitHub (Mar 20, 2024): Ups, wrong tagging, it should have been "ffes", sorry. But he wrote above "That works great! I tweaked it a bit, put two more blocks with split horizontally and split vertically. Now finally the command palette adds value for me!" I assume he's talking about some elements in the json-settings-file he made.
Author
Owner

@zadjii-msft commented on GitHub (Mar 20, 2024):

Probably something like:

{
    "iterateOn": "profiles",
    "icon": "${profile.icon}",
    "name": "New tab with profile: ${profile.name}",
    "command": { "action": "newTab", "profile": "${profile.name}" }
},
{
    "iterateOn": "profiles",
    "icon": "${profile.icon}",
    "name": "Split ${profile.name} vertically",
    "command": { "action": "splitPane", "profile": "${profile.name}", "split": "vertical" }
},
{
    "iterateOn": "profiles",
    "icon": "${profile.icon}",
    "name": "Split ${profile.name} horizontally",
    "command": { "action": "splitPane", "profile": "${profile.name}", "split": "horizontal" }
}
@zadjii-msft commented on GitHub (Mar 20, 2024): Probably something like: ```json { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "New tab with profile: ${profile.name}", "command": { "action": "newTab", "profile": "${profile.name}" } }, { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "Split ${profile.name} vertically", "command": { "action": "splitPane", "profile": "${profile.name}", "split": "vertical" } }, { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "Split ${profile.name} horizontally", "command": { "action": "splitPane", "profile": "${profile.name}", "split": "horizontal" } } ```
Author
Owner

@ffes commented on GitHub (Mar 21, 2024):

@zadjii-msft is absolutely right.

I even wrote a blogpost about it, back in the day: https://www.fesevur.com/2021/02/17/windows-terminal-command-palette/
Today I added an update to the blogpost.

@ffes commented on GitHub (Mar 21, 2024): @zadjii-msft is absolutely right. I even wrote a blogpost about it, back in the day: https://www.fesevur.com/2021/02/17/windows-terminal-command-palette/ Today I added an update to the blogpost.
Author
Owner

@BWWIT commented on GitHub (Mar 21, 2024):

@zadjii-msft is absolutely right.

I even wrote a blogpost about it, back in the day: https://www.fesevur.com/2021/02/17/windows-terminal-command-palette/ Today I added an update to the blogpost.

NICE! Thank you very much for effort, it works perfectly :-)

@BWWIT commented on GitHub (Mar 21, 2024): > @zadjii-msft is absolutely right. > > I even wrote a blogpost about it, back in the day: https://www.fesevur.com/2021/02/17/windows-terminal-command-palette/ Today I added an update to the blogpost. NICE! Thank you very much for effort, it works perfectly :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12608