Split with flags
Window 0 has five panes: a full-width tail pane at the bottom and a full-height pane on the left.
At the prompt, split-window takes flags the keys cannot:
-f- the new pane spans the full width or height of the window, not just the pane you split
-h/-v- side by side, or stacked. Typed out you say which; with neither, tmux assumes
-v -b- put the new pane before the one you split: to the left, or above
-d- leave the active pane where it is
Flags combine: -fhb is all three at once.
Order matters with -f: a full-width pane made first keeps the rows it took, so a full-height pane made after it spans only what is left.
Press C-b :, type splitw -fv tail -f ~/build.log, Enter.
A pane running tail spans the whole bottom and is active.
Press C-b :, type splitw -fhb, Enter.
A pane spans the full height at the far left and is active.
Press C-b :, type splitw -d, Enter.
A fifth pane appears below it, and the green border stays put.
How this maps to the split keys
C-b % and C-b " are split-window -h and -v with the defaults already filled in — which is why the prompt feels stricter than the keys.
A command after the flags runs in the new pane instead of a shell, the same way new-window takes one.
Here is what just happened.
-f split the window rather than the pane, -b chose the near side, and -d skipped the usual move of focus to the new pane. Without -d, every split moves the active pane, and the next split lands somewhere you did not mean.
- New pane spans the full width of the window, not just the pane being split:splitw -fv
- Full-height pane placed to the left of the pane being split:splitw -fhb
- Split without making the new pane the active pane:splitw -d
Go further
-l 10sets the new pane’s size in lines or columns;-l 30%a percentage.- The same flags work in a
bindline in.tmux.conf.
- 1The newest pane becomes active unless you say otherwise, so add
-dto the last split to keep the border where it is. - 2At the prompt nothing is assumed: give
-hor-vyourself.-fspans the whole window;-bputs the new pane before, meaning left or above. - 3
splitw -fv tail -f ~/build.log, thensplitw -fhb, thensplitw -d. Each fromC-b :.
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- A pane at the bottom of window 0 spans the full width and runs tail— not done yet
- A pane at the left of window 0 spans the full height— not done yet
- Window 0 of session learn has five panes— not done yet