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: tmux select-layout tidies a mess of panes in one command

Tmux
~/tips/tip-tmux-select-layout

select-layout tiled

Rearranges all panes in a tmux window into an even grid or evenly sized rows.

After a while the panes get unevenly sized. Reset them without dragging borders.

Ctrl-b :
select-layout tiled
# others: even-horizontal, even-vertical, main-vertical

Ctrl-b Space cycles through the same presets. tiled gives a grid, even-horizontal puts panes side by side at equal width.

The presets are even-horizontal, even-vertical, main-horizontal, main-vertical and tiled. The two main layouts give one large pane and the rest small, which is a good fit for an editor with a few helper shells. Tiled spreads everything evenly.

Press Ctrl-b Space until the window looks right, or give the command a preset name if you want one in particular. Pair it with synchronize-panes and tiled for the server-fleet case, since that gives every pane the same size.

A layout change resets any size you dragged by hand.

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: open new tmux panes in the folder you are already in, On this site: Ctrl-b Alt-arrow resizes a tmux pane five cells at a time

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