Ever needed to monitor different commands simultaneously? Windows Terminal makes it easy to split your terminal into multiple panes and run different commands in each one. Here’s how.
The Basic Command
wt -M pwsh -NoExit -c ls `; split-pane -H -s 0.66 pwsh -NoExit -c dir `; split-pane -H -s 0.5
Let’s break this down:
wt -M
: Launches Windows Terminal in maximized modepwsh -NoExit -c ls
: Runs PowerShell with thels
command in the first pane-NoExit
: Keeps the pane open after running the command-c ls
: Specifies the command to run
split-pane -H -s 0.66
: Creates a horizontal split, giving 34% to the first panepwsh -NoExit -c dir
: Runs thedir
command in the second panesplit-pane -H -s 0.5
: Creates another horizontal split, dividing the remaining space equally
The backticks (`
) before semicolons are necessary in PowerShell to escape the command separators.
Customizing The Layout
You can adjust the splits by modifying the -s
values:
- For two equal panes: use
-s 0.5
- For three equal panes: use
-s 0.66
followed by-s 0.5
- For four equal panes: use
-s 0.75
followed by-s 0.66
followed by-s 0.5
(basically $\frac{1}{4}$, $\frac{1}{3}$ and $\frac{1}{2}$) - For vertical splits: replace
-H
with-V
Practical Uses
This setup is particularly useful for:
- Monitoring different directories simultaneously
- Running and watching multiple processes
- Comparing command outputs in real-time
- Managing multiple git repositories
Try it out and customize the commands to fit your workflow!