Add top-level nested commands #9992

Open
opened 2026-01-31 02:09:34 +00:00 by claunia · 0 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 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9992