Tue, 29 Apr 2025 09:53:03 +0530
In this series of managing the tmux utility, the first level division, panes, are considered.
Panes divide the terminal window horizontally or vertically. Various combinations of these splits can result in different layouts, according to your liking.

This is how panes work in tmux.
Creating Panes
Take into focus any given pane. It could be a fresh window as well.
The current window can be split horizontally (up and down) with the key
[Ctrl+B] + "

And to split the pane vertically, use the combination
[Ctrl+B] + %

Resizing your panes
Tmux uses 'cells' to quantify the amount of resizing done at once. To quantify, this is what resizing by 'one cell' looks like. One more character can be accommodated on the side.

The combination part is a bit tricky for resizing. Stick with me.
Resize by one cell
Use the prefix Ctrl+B
followed by Ctrl+arrow
keys to resize in the required direction.
[Ctrl+B] Ctrl+arrow
This combination takes a fair number of keypresses, but can be precise.
Resize by five cells (quicker)
Instead of holding the Ctrl
key, you could use the Alt
key to resize faster. This moves the pane by five cells.
[Ctrl+B] Alt+arrow
Resize by a specific number of cells (advanced)
Just like before, the command line options can resize the pane to any number of cells.
Enter the command line mode with
[Ctrl+B] + :
Then type
resize-pane -{U/D/L/R} xx
U/D/L/R
represents the direction of resizingxx
is the number of cells to be resized
To resize a pane left by 20 cells, this is the command:
resize-pane -L 20
Resizing left by 20 cells
Similarly, to resize a pane upwards, the -U
tag is used instead.
Resizing upwards by 15 cells
This resize-pane command could be primarily incorporated into reprogramming a tmux layout whenever a new session is spawned.
Conclusion
Since the pane lengths are always bound to change, knowing all the methods to vary the pane sizes can come in handy. Hence, all possible methods are covered.
Pro tip ๐ - If you make use of a mouse with tmux, your cursor is capable of resizing the panes.
Turning on mouse mode and resizing the panes
Go ahead and tell me which method you use in the comments.
Recommended Comments