Split the window into panes
Window 0 has three panes: one on the left, two stacked on the right.
Two keys, one for each direction:
C-b %- split the active pane into left and right
C-b "- split it into top and bottom
The new pane becomes the active one, marked by the green border, so the next split lands there.
A pane is a rectangle of the window running its own program. One pane is active: typing goes there, and it is the default target for commands. The set of pane sizes and positions is the window’s layout.
Press C-b %.
The window splits into two panes side by side; the right one is active.
Press C-b ".
The right pane splits into top and bottom. Three panes, the bottom right active.
Why the flags are called -h and -v
The flag names behind these keys are the confusing part: split-window -h (horizontal) puts panes side by side, -v (vertical) stacks them. Think of the direction the new pane is added in, not the line between.
Here is what just happened.
C-b % ran split-window -h on the only pane; C-b " ran split-window -v on the pane that had just become active. Each split cuts the active pane and moves the green border to the new half, which is why no navigation was needed between them.
- Split the active pane into left and rightC-bthen%
- Split the active pane into top and bottomC-bthen"
Go further
- The same splits from the prompt:
split-window -handsplit-window -v, which also take flags for size and placement. - Panes can be split again and again until one is too small to divide.
- 1Release Ctrl after
C-b.%is Shift+5 on its own; holding Ctrl through it does nothing. - 2
C-b %splits left and right.C-b "splits top and bottom. The new pane becomes active. - 3
C-b %once, thenC-b "once. The second split lands in the right pane because it is already active.
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 has three panes— not done yet
- Window 0 has one pane on the left and a right column split into two— not done yet