brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Ctrl-b Alt-arrow resizes a tmux pane five cells at a time

Tmux
~/tips/tip-tmux-resize-alt

Ctrl-b Ctrl-Left # 1 cell

Resizes the active tmux pane in steps of five cells with the Alt and arrow keys.

Resizing with the plain Ctrl-arrow step of one cell takes forever.

Ctrl-b Ctrl-Left    # 1 cell
Ctrl-b Alt-Left     # 5 cells
Ctrl-b :resize-pane -R 10

Hold Alt instead of Ctrl after the prefix to move five cells at a time. The : prompt takes an exact number for one big jump.

Ctrl and an arrow move the border by one cell, which is fine for a final nudge. Alt and an arrow move it by five. Both repeat, so after the first press you can keep tapping the arrow without the prefix for a short moment.

For an exact size use the command prompt: Ctrl-b : and then resize-pane -R 10 grows the pane ten cells to the right. A pane can also be resized to a fixed width with resize-pane -x 80. And with mouse mode on, you can drag the border, which is the easy way if you have the mouse in your hand anyway.

On a Mac the Option key has to be set to act as Alt in your terminal app, otherwise the shortcut does nothing.

Try it without risk: start a throwaway session with tmux new -s scratch, use the shortcut or command above there, look at what changes, and close the session again with tmux kill-session -t scratch. Nothing else on your machine is touched.

Further reading: tmux manual page (OpenBSD, official), tmux wiki: Getting Started (official), On this site: tmux send-keys types into a pane you are not looking at, On this site: Ctrl-b { and Ctrl-b } swap the active pane with its neighbour

More Tmux tips tmux new -d -s report -x 200 -y 50 'top' tmux wait-for build-done set -g allow-passthrough on tmux kill-server Ctrl-b [ All Tmux tips (125) All topics

Link