Apply window layouts
Window 0 has been even-vertical, then main-vertical, and is now tiled.
select-layout name at the prompt rearranges every pane in the window at once. C-b Space cycles the same presets in order.
There are five:
even-horizontal- equal columns, side by side
even-vertical- equal rows, stacked
main-horizontal- one large pane on top, the rest in a row beneath
main-vertical- one large pane on the left, the rest stacked on the right
tiled- a grid
Applying a layout keeps every pane’s contents and the active pane; it only recomputes sizes. Any manual resizing you did is overwritten.
Press C-b :, type select-layout even-vertical, Enter.
Four equal rows.
Press C-b :, type select-layout main-vertical, Enter.
A is large on the left; B, C and D stack on the right.
Press C-b Space until you see a two-by-two grid.
That is tiled.
Layout presets and tmux versions
C-b M-1 to M-5 apply presets directly — M-7 on tmux 3.5 and newer, which added mirrored main layouts. Which number means which shifted between versions, so C-b / then the key is the way to check yours.
Here is what just happened.
select-layout and next-layout (C-b Space) both rebuild the window from a preset. A zoomed window unzooms first, since a layout needs every pane visible. Manual resizes are simply overwritten.
- Rotate to the next preset layoutC-bthenSpace
- Apply a layout by name: even-horizontal, even-vertical, main-horizontal, main-vertical or tiled:select-layout name
- Apply a preset layout directly; confirm what each Meta key does with C-b /C-bthenM-1
Go further
select-layout -Ere-spreads panes on the current layout, undoing manual resizes.display-message -p '#{window_layout}'prints the raw layout string tmux uses internally.C-b M-1applieseven-horizontaldirectly; check the others withC-b /thenM-3.
- 1Order matters and each layout is checked in turn: even-vertical, then main-vertical, then tiled.
- 2
C-b :thenselect-layout even-vertical. Repeat formain-vertical, thentiled. - 3
C-b Spacecycles the presets in order, so it reaches all three without typing, but it is easy to overshoot.
This is a live terminal. Typing goes to the machine, including Tab. Press Shift and Tab together to move focus back out to the page.
A real terminal, in this tab
Alpine Linux and tmux 3.4 on an x86 emulator. Nothing to install, and no server behind it.
about 15 MB, once
Done when
not started- Window 0 of session learn is arranged in a single column, no nesting— not done yet
- Window 0 of session learn has one large pane on the left and a stacked column on the right— not done yet
- Window 0 of session learn is tiled: two rows of two panes— not done yet