Jump to content

Welcome to CodeNameJessica

โœจ Welcome to CodeNameJessica! โœจ

๐Ÿ’ป Where tech meets community.

Hello, Guest! ๐Ÿ‘‹
You're just a few clicks away from joining an exclusive space for tech enthusiasts, problem-solvers, and lifelong learners like you.

๐Ÿ” Why Join?
By becoming a member of CodeNameJessica, youโ€™ll get access to:
โœ… In-depth discussions on Linux, Security, Server Administration, Programming, and more
โœ… Exclusive resources, tools, and scripts for IT professionals
โœ… A supportive community of like-minded individuals to share ideas, solve problems, and learn together
โœ… Project showcases, guides, and tutorials from our members
โœ… Personalized profiles and direct messaging to collaborate with other techies

๐ŸŒ Sign Up Now and Unlock Full Access!
As a guest, you're seeing just a glimpse of what we offer. Don't miss out on the complete experience! Create a free account today and start exploring everything CodeNameJessica has to offer.

by: Pranav Krishna
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.

Tmux window splitting into panes
Pane split of a tmux window

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] + "
horizontal split
Horizontal Split

And to split the pane vertically, use the combination

[Ctrl+B] + %
vertical split
Vertical Split

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.

resize by one cell
Resizing by 'one cell'

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.

0:00
/0:08

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
0:00
/0:12

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 resizing
  • xx is the number of cells to be resized

To resize a pane left by 20 cells, this is the command:

resize-pane -L 20
0:00
/0:06

Resizing left by 20 cells

Similarly, to resize a pane upwards, the -U tag is used instead.

0:00
/0:05

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.

0:00
/0:15

Turning on mouse mode and resizing the panes

Go ahead and tell me which method you use in the comments.

0 Comments

Recommended Comments

There are no comments to display.

Guest
Add a comment...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.