Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Save panes layout as a profile which can be opened via the open tab menu #10717

Closed
BenjaminNolan opened this issue Jul 20, 2021 · 4 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@BenjaminNolan
Copy link

BenjaminNolan commented Jul 20, 2021

Description of the new feature/enhancement

Currently, it's possible to open a layout by creating a shortcut which opens the Terminal with a bunch of CLI options, which is great, however it'd be much nicer and more user-friendly to be able to create a layout directly in the interface by splitting panes and setting their heights and widths with the various keyboard shortcuts, and then clicking a Save as Profile option in the Open Tab drop-down menu which will add it to that drop-down as a future option when opening a new tab.

Proposed technical implementation details (optional)

On the settings.json front, you could do something like this?

{
  "profiles": {
    "list": [
      {
        "guid": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}", // The profile I want to use for the actual panes themselves
        "hidden": false,
        "name": "Ubuntu-20.04",
        "source": "Windows.Terminal.Wsl"
      },
      {
        "guid": "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}", // The new profile added by saving the custom layout
        "hidden": false,
        "name": "My Custom Layout",
        "source": "Windows.Terminal.Layout"
      }
    ]
  },
  "layouts": {
    "{2ece5bfe-50ed-5f3a-ab87-5cd4baafed2b}": { // Same GUID as the profile, perhaps?
      "panes": [
        {
          "width": 50, // A vertical split pane with three children. I've assumed percentages here rather than columns and rows so everything resizes correctly.
          "children": [
            {
              "height": 50,
              "profile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}" // The id of the profile to open in this pane. In this example, they're all the same, but there's no reason why they couldn't be different.
            },
            {
              "height": 25,
              "profile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}"
            },
            {
              "height": 25,
              "profile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}"
            }
          ]
        },
        {
          "width": 50, // A vertical split pane with two children
          "children": [
            {
              "height": 75,
              "profile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}"
            },
            {
              "height": 25,
              "profile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}"
            }
          ]
        }
      ]
    }
  }
}

That would create this, for example:
Example Windows Terminal multi-pane layout

Apologies if this is a duplicate, I did look through before creating it!

@BenjaminNolan BenjaminNolan added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jul 20, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 20, 2021
@zadjii-msft
Copy link
Member

So for reference, I like to do like the following each time I boot up the Terminal in the morning:

{ "command": { "action": "wt", "commandline": "new-tab --title OpenConsole cmd.exe /k #work 15 ; split-pane -s .30 --title OpenConsole cmd.exe /k #work 15 ; split-pane  -s .25 -H cmd.exe /k media ; new-tab --title \"Symbols Script\" powershell dev\\symbols.ps1 ; new-tab -p \"Ubuntu 18.04\" ; new-tab -p \"microsoft/Terminal\" ; sp -V -p \"microsoft/Terminal\" ; sp -H -p \"microsoft/Terminal\" ; focus-tab -t 0" }, "name": "Good Morning" },

(you could probably make it shorter by replacing new-tab/split-pane with nt/sp, respectively).

I add that to the keybindings/actions. This creates a new command in the Command Palette named "Good Morning". That opens up a few tabs & panes, running various build environments. I like having it in a command rather than startupActions, because I only really want this in one terminal window, not every single one I launch. It's personal taste.

You could repeat this for multiple different "session"s if you wanted. That way you could have layouts pre-defined for various different dev environments.

We're also tracking adding commands to the new tab dropdown in #1571.

More specifically though, I think this is roughly /dup #756

@ghost
Copy link

ghost commented Jul 20, 2021

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Jul 20, 2021
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 20, 2021
@BenjaminNolan
Copy link
Author

@zadjii-msft Not sure this is a true duplicate of #756, as it was intended more to be about the ability to create a layout using the split pane commands in an existing tab and then save them as a profile that can be opened later via the commands in the tab dropdown that are mentioned in #1571 (prime number, nice ^^), so that's on me for not really explaining the thought properly, but there is definitely a lot of cross-over between them.

Do you think it's worth mentioning the ability to save the current pane layout in a comment on #1571?

@rajhlinux
Copy link

How are you actually able to do this? I also would like to have a preset settings which will open multiple tabs in certain order where multiple terminals are stacked vertically and horizontally.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants