microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.97k stars 8.35k forks source link

Add nested commands to the Command Palette #3994

Closed zadjii-msft closed 4 years ago

zadjii-msft commented 4 years ago

The initial design of the command palette only covers singular commands, but includes a follow-up to support nesting commands. This way, all the commands don't appear in the menu straight away. Instead, the user must first select the parent command, to be given the sub-list.

We should support this.

cryptworks commented 4 years ago

I would +1 to this. Recently working with the terminal profiles.json I was having fun with calling directly to the native windows SSH "ssh.exe user@addr" as its own profile. The ability to make a manuitem to call to a separate config as its own menu entry would be tremendous. Even supporting a nested entry of ssh x@x calls with a singular master config entry would be great.

giggio commented 4 years ago

@zadjii-msft How do we add those nested commands? Is there a commands.json or something like that? I couldn't find it. Or is it on the settings file? If it is, I couldn't find it on schema.

Or is it not supposed to be user customizable?

zadjii-msft commented 4 years ago

@giggio If you're using a build that includes #6856, you can do something like the following:

        {
            "name": "Split Pane...",
            "commands": [
                {
                    "iterateOn": "profiles",
                    "name": "Split with ${profile.name}...",
                    "commands": [
                        { "command": { "action": "splitPane", "profile": "${profile.name}", "split": "auto" } },
                        { "command": { "action": "splitPane", "profile": "${profile.name}", "split": "vertical" } },
                        { "command": { "action": "splitPane", "profile": "${profile.name}", "split": "horizontal" } }
                    ]
                }
            ]
        },

Just throw that into your keybindings, and that should work.

giggio commented 4 years ago

Perfect, it works! I was not sure where to put it. There should be an issue to update the schema.

zadjii-msft commented 4 years ago

@giggio I'm purposely not updating the docs until we feel it's ready for general adoption 😉

The docs will probably be updated as a part of #7174

giggio commented 4 years ago

Not the docs, the schema: https://github.com/microsoft/terminal/blob/master/doc/cascadia/profiles.schema.json

zadjii-msft commented 4 years ago

Sorry, in my head, the schema is part of the docs. I get how that's confusing 😛

ghost commented 4 years ago

:tada:This issue was addressed in #6856, which has now been successfully released as Windows Terminal Preview v1.3.2382.0.:tada:

Handy links: