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

Create a guide for starting with multiple tabs/panes using Command Palette and/or startupActions #315

Open
zadjii-msft opened this issue Apr 23, 2021 · 2 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed tips-and-tricks Guides that should be added to the "Tips and Tricks" page

Comments

@zadjii-msft
Copy link
Contributor

We get dupes of microsoft/terminal#766 literally all the time in the main repo. Maybe it would be useful to add a guide on using the command palette / startupActions to alleviate that pain. Below is the text I use as a saved reply for these dupes. Someone just needs to massage this into a guide on the Tips and Tricks page.


Thanks for the suggestion! Looks like we're tracking this in microsoft/terminal#776.

dup #766


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 microsoft/terminal#1571.

@zadjii-msft zadjii-msft added the tips-and-tricks Guides that should be added to the "Tips and Tricks" page label Apr 23, 2021
@zorgick
Copy link

zorgick commented Apr 29, 2021

Hi @zadjii-msft I just found your trick and I'm trying to implement it according to my needs, but I'm struggling to do it correctly.

When I run this command,

{ "command": { "action": "wt", "commandline": "nt wsl.exe ; sp -H -s .30 wsl.exe ; sp -V wsl.exe ; sp -V wsl.exe ; focus-tab -t 0" }, "name": "Good Morning" },

I want my session to look like this,
image

But instead bottom panes are not split equally, and I receive this

image

Do you know how to make WT to resize panes equally using WT commands?

Or maybe there is a way to preserve a session like in tmux?

@BrunoBlanes
Copy link

@zorgick you can add -s .66 to you first split in the lower section to specify that you want 66% of the space left, which in turn would make the first pane 34% and the last two would split equally at 33%. That's the closest you'll get to a perfect 1/3 split.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed tips-and-tricks Guides that should be added to the "Tips and Tricks" page
Projects
None yet
Development

No branches or pull requests

6 participants