How do you create a grid layout of panes equally distributed from a script? #19136

Open
opened 2026-01-31 06:34:47 +00:00 by claunia · 0 comments
Owner

Originally created by @brupelo on GitHub (Dec 25, 2022).

Consider this script foo.cmd

set BD=d:\

wt -w %~n0 ^
nt --title="tab1" --startingDirectory=%BD% ; ^
sp --title="tab2" --startingDirectory=%BD% ; ^
sp --title="tab3" --startingDirectory=%BD% ; ^
sp --title="tab4" --startingDirectory=%BD% ; ^
sp --title="tab5" --startingDirectory=%BD% ; ^
sp --title="tab6" --startingDirectory=%BD% ;

When I run it from the terminal I'll get this:

image

There are few questions here:

  1. You can see how a new tab called "Command Prompt" has been created, is there any way to prevent that?

  2. I'd like to learn how to arrange my 6 panes in something like this:

image

In the above image I did that manually but I'd like to create this sort of arrangement from my script foo.cmd, so how can I modify my script to acomplish that?

Basically my goal is each pane is taking 1/6 of the total client area.

  1. What's the rationale of wt sp --help, wt --help, ... , wt cmd --help creating a window rather than writing to stdout as usual?

  2. Let's say on %BD% there is a virtualenv that i want to activate venv\Scripts\activate so then I can run few scripts python fancy_server, how can I modify my script to do that?

I wasn't sure where to ask these question... although reading the docs I'm still trying to figure out how you could achieve this one.

Maybe having a section

image

would be more convenient?

Thanks in advance!

Ps. Basically the idea here is migrating some old conemu scripts where i'd be able to spin up few microservices like this:

-cur_console:d:d:\microservices\local -cur_console:t:microservice1 cmd /k run_ms1.cmd

-cur_console:ns1T65H -cur_console:d:d:\microservices\local -cur_console:t:microservice2 cmd /k run_ms2.cmd

-cur_console:ns1T50V -cur_console:d:d:\microservices\local -cur_console:t:microservice3 cmd /k run_ms3.cmd

-cur_console:ns2T50V -cur_console:d:d:\microservices\local -cur_console:t:microservice4 cmd /k run_ms4.cmd

-cur_console:ns2T50H -cur_console:d:d:\microservices\local -cur_console:t:microservice5 cmd /k run_ms5.cmd

> -cur_console:ns4T50H -cur_console:d:d:\microservices\local -cur_console:t:microservice6 cmd /k run_ms6.cmd

where each run_ms.cmd would cd/pushd/popd into the microservice directory and call python, docker, whatever... I'd like to learn how to accomplish this (having this in a single standalone script would be great) using windows terminal

Originally created by @brupelo on GitHub (Dec 25, 2022). Consider this script `foo.cmd` ``` set BD=d:\ wt -w %~n0 ^ nt --title="tab1" --startingDirectory=%BD% ; ^ sp --title="tab2" --startingDirectory=%BD% ; ^ sp --title="tab3" --startingDirectory=%BD% ; ^ sp --title="tab4" --startingDirectory=%BD% ; ^ sp --title="tab5" --startingDirectory=%BD% ; ^ sp --title="tab6" --startingDirectory=%BD% ; ``` When I run it from the terminal I'll get this: ![image](https://user-images.githubusercontent.com/18058492/209463282-ba2ef771-183f-4466-a35c-f63d9232ddb7.png) There are few questions here: 1) You can see how a new tab called "Command Prompt" has been created, is there any way to prevent that? 2) I'd like to learn how to arrange my 6 panes in something like this: ![image](https://user-images.githubusercontent.com/18058492/209463333-063b295c-feea-49ac-a146-c1c76f8d824a.png) In the above image I did that manually but I'd like to create this sort of arrangement from my script `foo.cmd`, so how can I modify my script to acomplish that? Basically my goal is each pane is taking 1/6 of the total client area. 3) What's the rationale of `wt sp --help`, `wt --help`, ... , `wt cmd --help` creating a window rather than writing to stdout as usual? 4) Let's say on %BD% there is a virtualenv that i want to activate `venv\Scripts\activate` so then I can run few scripts `python fancy_server`, how can I modify my script to do that? I wasn't sure where to ask these question... although reading the [docs](https://learn.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=windows) I'm still trying to figure out how you could achieve this one. Maybe having a section ![image](https://user-images.githubusercontent.com/18058492/209463455-65e64751-9537-403f-bbd2-66efba9e6908.png) would be more convenient? Thanks in advance! Ps. Basically the idea here is migrating some old conemu scripts where i'd be able to spin up few microservices like this: ``` -cur_console:d:d:\microservices\local -cur_console:t:microservice1 cmd /k run_ms1.cmd -cur_console:ns1T65H -cur_console:d:d:\microservices\local -cur_console:t:microservice2 cmd /k run_ms2.cmd -cur_console:ns1T50V -cur_console:d:d:\microservices\local -cur_console:t:microservice3 cmd /k run_ms3.cmd -cur_console:ns2T50V -cur_console:d:d:\microservices\local -cur_console:t:microservice4 cmd /k run_ms4.cmd -cur_console:ns2T50H -cur_console:d:d:\microservices\local -cur_console:t:microservice5 cmd /k run_ms5.cmd > -cur_console:ns4T50H -cur_console:d:d:\microservices\local -cur_console:t:microservice6 cmd /k run_ms6.cmd ``` where each run_ms.cmd would cd/pushd/popd into the microservice directory and call python, docker, whatever... I'd like to learn how to accomplish this (having this in a single standalone script would be great) using windows terminal
claunia added the Resolution-DuplicateIssue-Docs labels 2026-01-31 06:34:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19136