Skip to content

Add top-level nested commands #7174

@zadjii-msft

Description

@zadjii-msft

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

Metadata

Metadata

Labels

Area-SettingsIssues related to settings and customizability, for console or terminalIssue-QuestionFor questions or discussionProduct-TerminalThe new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions