learntmux.dev

Split with flags

Goal

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.

Do this

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.

Stuck on this one?

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

about 15 MB, once

session learn

Done when

not started
  1. A pane at the bottom of window 0 spans the full width and runs tail— not done yet
  2. A pane at the left of window 0 spans the full height— not done yet
  3. Window 0 of session learn has five panes— not done yet