Repository: terminal
Issue: Option to define a custom tab layout for new windows
Labels: Issue-Feature,Area-UserInterface,Product-Terminal

<!-- 
🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨

I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement.
2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement.
3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number).
4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement.
5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement.

All good? Then proceed!
-->

# Description of the new feature/enhancement

I'd like the option to have a persisted window layout from last session is good, but personally I'd like to have the option to have a static tab layout that opens with new windows.

Currently I can either pick a default profile which also becomes the default option when I click the "+" button, or to reuse the tab layout from last session, but no way to have a statically and persistent tab layout.

The technical implementation of the core functionality should be relatively trivial, most of the logic already exists in place from the "last session", as you can simply copy the schema and logic from the `persistedWindowLayouts` property of `state.json`, and store it in settings.json and load the configuration from there. There might be some slight window positioning logic changes required for things like window size/position, depending on how the existing implementation works.

## UI Mockup

The most complicated bit, I think, would be to craft a UI to manage this setting. My suggestion is to put the "When Terminal starts" option under the "Launch parameters" group, since I believe the "restore previous session" feature overrides those settings anyway, making it a possibility to disable the inputs when a choice other than "launch default profile" is selected. Given the complexity of configuring multiple windows and which tabs they have, I'd suggest a separate view for managing those, accessed from a button under the "Launch parameters" group.

I have created a couple of mockups to demonstrate my ideas, and as a starting point for discussing the UI/UX of this.

----
[Fig. 1]
![1  Startup View - Default Profile](https://github.com/microsoft/terminal/assets/1394292/13bd810f-8aaa-430d-a9a4-ba005319b2ce)

This is how the current behavior when "Open a tab with the default profile" is selected under "When Terminal Starts" would look in my proposal.

----
[Fig. 2]
![2  Startup View - From Previous Session](https://github.com/microsoft/terminal/assets/1394292/7b1d7da6-1cbd-4559-af6e-089af953bee4)

This is how the current behavior when "Open windows from a previous session" is selected under "When Terminal Starts" would look in my proposal. Notice that the settings are disabled, since they will be overridden by the parameters in state.json anyway (if I've interpreted things correctly)

----
[Fig. 3]
![3  Startup View - Custom Layout](https://github.com/microsoft/terminal/assets/1394292/25515970-5a96-4dbc-bac6-16b814673c01)

This is the 3rd new option that would enable the "Manage Tab Layouts" button. The other settings are again disabled because they will now be defined on a per-window basis in the new layout manager view.

----
[Fig. 4]
![4  Layout Editor](https://github.com/microsoft/terminal/assets/1394292/d98ae48b-6397-4da4-8aa4-4ca3c82a7df9)

My suggestion for a new layout editor view, you get here by clicking the "Manage Tab Layouts" button in the previous screen. You can have one or more windows (just like when restoring the previous session), and each window can have their launch parameters individually specified. I'm unsure how feasible the mock-tab view on the top bar would be to implement, but it gives a quick and easy glanceable indication of what the configuration actually is. The radio buttons control which one will be the focused/open tab when the window starts.

---

There are probably a few basic things I've missed (like I now notice that I forgot to include a button to remove an entire window), and I'm unsure if I think the "Add Tab" button works as well as a title for the following list as I had hoped. I'd probably add a title and have the button next to it. I'm also not enjoying the huge amount of unused space this design is creating with each added tab, but I was trying to avoid creating too many fancy UI elements I could not find elsewhere, (besides the visual tab preview, but that's more a nice to have rather than critical for the implementation).

There also needs to be something that communicates what the radio buttons actually do, but that could just be a small text blurb at the bottom or something.

<!-- 
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
-->