Add top-level nested commands #9994

Closed
opened 2026-01-31 02:09:37 +00:00 by claunia · 4 comments
Owner

Originally created by @zadjii-msft on GitHub (Aug 4, 2020).

Originally assigned to: @DHowett, @miniksa on GitHub.

I'm filing this one to get team feedback for what commands we should include in the defaults once #6856 lands. I'm gonna throw the usual suspects on the Assigned To line, and remove yourself when you've shared thoughts


Shouldn't we replace the "newTab" and "splitPane" entries here with nested/iterable commands?

I was thinking, something neat would be to make the tree look like this:

<Command Palette>
└─ Open Profile...
   ├─ Profile 1...
   |  ├─ New Tab
   |  ├─ Split Automatically
   |  ├─ Split Vertically
   |  └─ Split Horizontally
   ├─ Profile 2...
   |  ├─ New Tab
   |  ├─ Split Automatically
   |  ├─ Split Vertically
   |  └─ Split Horizontally
   └─ Profile 3...
      ├─ New Tab
      ├─ Split Automatically
      ├─ Split Vertically
      └─ Split Horizontally

_Originally posted by @carlos-zamora in #6856


Yea, that's what I was thinking too, but I think I wanted to open a broader discussion with the team for what these commands should be. I was thinking that there's be two top-level ones (Split pane... and New Tab...), but I want a team consensus on those.


In my head, this is how I pictured it:

  {
    "name": "New tab...",
    "commands": [
      {
        "iterateOn": "profiles",
        "icon": "${profile.icon}",
        "name": "${profile.name}",
        "command": { "action": "newTab", "profile": "${profile.name}" }
      }
    ]
  },
  {
    "name": "Split pane...",
    "commands": [
      {
        "iterateOn": "profiles",
        "icon": "${profile.icon}",
        "name": "${profile.name}...",
        "commands": [
          {
            "name": "Split automatically",
            "command": { "action": "splitPane", "profile": "${profile.name}", "split": "automatic" }
          },
          {
            "name": "Split vertically",
            "command": { "action": "splitPane", "profile": "${profile.name}", "split": "vertical" }
          },
          {
            "name": "Split horizontally",
            "command": { "action": "splitPane", "profile": "${profile.name}", "split": "horizontal" }
          }
        ]
      }
    ]
  }

Which then would evaluate to

<Command Palette>
├─ New tab...
|  ├─ Profile 1
|  ├─ Profile 2
|  └─ Profile 3
└─ Split pane...
   ├─ Profile 1...
   |  ├─ Split Automatically
   |  ├─ Split Vertically
   |  └─ Split Horizontally
   ├─ Profile 2...
   |  ├─ Split Automatically
   |  ├─ Split Vertically
   |  └─ Split Horizontally
   └─ Profile 3...
      ├─ Split Automatically
      ├─ Split Vertically
      └─ Split Horizontally
Originally created by @zadjii-msft on GitHub (Aug 4, 2020). Originally assigned to: @DHowett, @miniksa on GitHub. I'm filing this one to get **team feedback** for what commands we should include in the defaults once #6856 lands. I'm gonna throw the usual suspects on the Assigned To line, and remove yourself when you've shared thoughts <hr> Shouldn't we replace the "newTab" and "splitPane" entries here with nested/iterable commands? I was thinking, something neat would be to make the tree look like this: ``` <Command Palette> └─ Open Profile... ├─ Profile 1... | ├─ New Tab | ├─ Split Automatically | ├─ Split Vertically | └─ Split Horizontally ├─ Profile 2... | ├─ New Tab | ├─ Split Automatically | ├─ Split Vertically | └─ Split Horizontally └─ Profile 3... ├─ New Tab ├─ Split Automatically ├─ Split Vertically └─ Split Horizontally ``` _Originally posted by @carlos-zamora in #6856 <hr> > Yea, that's what I was thinking too, but I think I wanted to open a broader discussion with the team for what these commands should be. I was thinking that there's be two top-level ones (Split pane... and New Tab...), but I want a team consensus on those. <hr> In my head, this is how I pictured it: ```json { "name": "New tab...", "commands": [ { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "${profile.name}", "command": { "action": "newTab", "profile": "${profile.name}" } } ] }, { "name": "Split pane...", "commands": [ { "iterateOn": "profiles", "icon": "${profile.icon}", "name": "${profile.name}...", "commands": [ { "name": "Split automatically", "command": { "action": "splitPane", "profile": "${profile.name}", "split": "automatic" } }, { "name": "Split vertically", "command": { "action": "splitPane", "profile": "${profile.name}", "split": "vertical" } }, { "name": "Split horizontally", "command": { "action": "splitPane", "profile": "${profile.name}", "split": "horizontal" } } ] } ] } ``` Which then would evaluate to ``` <Command Palette> ├─ New tab... | ├─ Profile 1 | ├─ Profile 2 | └─ Profile 3 └─ Split pane... ├─ Profile 1... | ├─ Split Automatically | ├─ Split Vertically | └─ Split Horizontally ├─ Profile 2... | ├─ Split Automatically | ├─ Split Vertically | └─ Split Horizontally └─ Profile 3... ├─ Split Automatically ├─ Split Vertically └─ Split Horizontally ```
Author
Owner

@cinnamon-msft commented on GitHub (Aug 18, 2020):

I prefer the layout of option 2. However, I could see a use case for people searching for a specific profile and the default behavior would be to open a new tab.

@cinnamon-msft commented on GitHub (Aug 18, 2020): I prefer the layout of option 2. However, I could see a use case for people searching for a specific profile and the default behavior would be to open a new tab.
Author
Owner

@leonMSFT commented on GitHub (Aug 19, 2020):

I like 2 better as well, its layout seems more logical to me. IMO I feel like if I wanted to open a New Tab or Split Pane (with a specific profile or not), I'd look through the cmdpal for those commands verbatim instead of looking for Open Profile.

In addition to the nested New Tab and Split Pane, I'd still like to leave in a non-nested version of New Tab and Split Pane that do their default behaviors for quick one-shot enter keypresses instead of double/triple keypress to navigate through the nested versions.

@leonMSFT commented on GitHub (Aug 19, 2020): I like 2 better as well, its layout seems more logical to me. IMO I feel like if I wanted to open a `New Tab` or `Split Pane` (with a specific profile or not), I'd look through the cmdpal for those commands verbatim instead of looking for `Open Profile`. In addition to the nested `New Tab` and `Split Pane`, I'd still like to leave in a non-nested version of `New Tab` and `Split Pane` that do their default behaviors for quick one-shot <kbd>enter</kbd> keypresses instead of double/triple keypress to navigate through the nested versions.
Author
Owner

@zadjii-msft commented on GitHub (Aug 19, 2020):

Alright well that's enough consensus for me to go on. I'll ship a PR for option 2, and we'll finish discussion in the PR. Thanks guys!

@zadjii-msft commented on GitHub (Aug 19, 2020): Alright well that's enough consensus for me to go on. I'll ship a PR for option 2, and we'll finish discussion in the PR. Thanks guys!
Author
Owner

@ghost commented on GitHub (Aug 26, 2020):

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

Handy links:

@ghost commented on GitHub (Aug 26, 2020): :tada:This issue was addressed in #7348, which has now been successfully released as `Windows Terminal Preview v1.3.2382.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.3.2382.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9994