terminal icon indicating copy to clipboard operation
terminal copied to clipboard

Option to define a custom tab layout for new windows

Open SimplyLinn opened this issue 2 years ago • 4 comments

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

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

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

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

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.

SimplyLinn avatar Nov 13 '23 15:11 SimplyLinn

Hey, this looks really cool! It's not something that I'm ready to commit to (since we've got some other stuff going on right now :smile:), so I'll keep it open and on the backlog. Thanks!

DHowett avatar Nov 15 '23 22:11 DHowett

Yeah, I figured this wouldn't be a priority from the maintainers, but if I ever get the "fuck it, I want this feature, and I want it now" and decided to implement it myself in some spurt of energy in the future, I wanted to have it run by the relevant people so I knew there was support for the general idea in case I make a PR 🙂

(But I wouldn't hold my breath for me implementing it... I also got some other stuff going on right now 😄 )

SimplyLinn avatar Nov 15 '23 22:11 SimplyLinn

Hmm - I was just perusing the backlog, and #11526 looks like it might be the same thing? Or at least trying to achieve a lot of the same goals.

zadjii-msft avatar Apr 09 '25 21:04 zadjii-msft

Oh, you're correct @zadjii-msft! I promise I did try and search before opening this...

I'll leave it to the maintainers to figure out how to deal with merging the duplicates, as I my issue has the mockups and whatnot that might be helpful

SimplyLinn avatar Apr 10 '25 06:04 SimplyLinn