Support for "session" #12629

Closed
opened 2026-01-31 03:20:38 +00:00 by claunia · 6 comments
Owner

Originally created by @dov on GitHub (Feb 18, 2021).

Description of the new feature/enhancement

Mostly, when I run terminal I start with opening a fixed set of tabs, each in a different directory, and each with a different a different title. I'd like a way to automize this.

Proposed technical implementation details (optional)

I suggest that you add to Terminal command line an option to take a json file with the requested layout.

Originally created by @dov on GitHub (Feb 18, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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 Mostly, when I run terminal I start with opening a fixed set of tabs, each in a different directory, and each with a different a different title. I'd like a way to automize this. <!-- 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). --> # Proposed technical implementation details (optional) I suggest that you add to Terminal command line an option to take a json file with the requested layout. <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureResolution-Duplicate labels 2026-01-31 03:20:38 +00:00
Author
Owner

@skyline75489 commented on GitHub (Feb 18, 2021):

Would you be satisfied by the solution mentioned in https://github.com/microsoft/terminal/issues/9101#issuecomment-777034523 ?

@skyline75489 commented on GitHub (Feb 18, 2021): Would you be satisfied by the solution mentioned in https://github.com/microsoft/terminal/issues/9101#issuecomment-777034523 ?
Author
Owner

@dov commented on GitHub (Feb 18, 2021):

Would you be satisfied by the solution mentioned in #9101 (comment) ?

That indeed looks promising! It is not clear whether it is possible to do a cd to a different directory through that approach though.

@dov commented on GitHub (Feb 18, 2021): > Would you be satisfied by the solution mentioned in [#9101 (comment)](https://github.com/microsoft/terminal/issues/9101#issuecomment-777034523) ? That indeed looks promising! It is not clear whether it is possible to do a cd to a different directory through that approach though.
Author
Owner

@skyline75489 commented on GitHub (Feb 18, 2021):

That's largely related to the shells. For example with pwsh.exe you can use:

wt new-tab pwsh.exe -WorkingDirectory D:
@skyline75489 commented on GitHub (Feb 18, 2021): That's largely related to the shells. For example with `pwsh.exe` you can use: ```text wt new-tab pwsh.exe -WorkingDirectory D: ```
Author
Owner

@skyline75489 commented on GitHub (Feb 18, 2021):

By the wt way is actually working with 1.5. You'll need to wait for 1.6 to use the startupActions. Follow #756 for future updates on this topic.

@skyline75489 commented on GitHub (Feb 18, 2021): By the `wt` way is actually working with 1.5. You'll need to wait for 1.6 to use the `startupActions`. Follow #756 for future updates on this topic.
Author
Owner

@zadjii-msft commented on GitHub (Feb 18, 2021):

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. Largely, I'm going to call this ask a duplicate of both #756 and #1571.

/dup #756
/dup #1571

@zadjii-msft commented on GitHub (Feb 18, 2021): So for reference, I like to do like the following each time I boot up the Terminal in the morning: ```json { "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](https://docs.microsoft.com/en-us/windows/terminal/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. Largely, I'm going to call this ask a duplicate of both #756 and #1571. /dup #756 /dup #1571
Author
Owner

@ghost commented on GitHub (Feb 18, 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 commented on GitHub (Feb 18, 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!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12629