Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to split Windows Terminal into 8 equal panes "programmatically"?

I am trying to split the new Windows Terminal into 8 equal panes by running one or more commands.

Recently Microsoft added support for splitting the new Windows Terminal into panes "programmatically" by using the parameters:

split-pane -H or -V (Horizontal or Vertical pane)

I have tried a dozen combinations of the parameters, but it splits the terminal windows "wrong".

Here is an example:

wt `; split-pane -V -p "pwsh" `; split-pane -H -p "pwsh" `; split-pane -V -p "pwsh"

Here is the desired result: Screenshot of 8 equally split panes in Windows Terminal How would I achieve this programmatically? It's possible to do in the Windows Terminal by using hotkeys ALT+SHIFT+MINUS and ALT+SHIFT+PLUS (see screenshot).

like image 676
JamesRicky Avatar asked Oct 18 '25 19:10

JamesRicky


1 Answers

A little late but here is a solution

"startupActions": "-p \"Bash\" ; split-pane -p \"Bash\" -V ; move-focus left ;  split-pane -p \"Bash\" -H ; move-focus right;split-pane -p \"Bash\" -H ; move-focus up ; move-focus left ; split-pane -p \"Bash\" -V ; move-focus down ; split-pane -p \"Bash\" -V ; move-focus right ; move-focus up ; split-pane -p \"Bash\" -V move-focus down ; split-pane -p \"Bash\" -V"

It is not the prettiest but it is working.

like image 94
Joey Avatar answered Oct 22 '25 07:10

Joey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!