Sessions, the prefix key, panes, windows, detach and reattach.
Start a session, learn the prefix key that every other shortcut hangs off, split the window into panes, and detach without losing your work.
11 tasks · about 46 minutes · 25 key bindings
Start with task 1- 01
Start your first session
3 minRun tmux from the shell to start the server, create a named session and see the status line.
tmux newtmux new -s nametmux new -n name - 02
The prefix key and new windows
3 minPress the prefix key for the first time to open new windows and watch the window list grow in the status line.
C-bthencC-bthenC-b - 03
Find any key with the help list
4 minOpen the built-in key list in view mode, scroll it, look up a single key, then use a key you found there.
C-bthen?C-bthen/C-bthent - 04
Run commands from the command prompt
3 minUse the tmux command prompt to run new-window with flags instead of a key binding.
C-bthen::neww -d -n name:neww command - 05
Detach and come back
4 minStart a log tail, detach from the session, and reattach to find it still running.
C-bthendtmux attach -t name - 06
Read the session list and juggle sessions
5 minList sessions from the shell, pick the right one by its window count, run a program in a new session, and reattach safely with new -A.
tmux lstmux new -s name -n name commandtmux new -A -s name - 07
Split the window into panes
3 minCut one pane into two side by side, then split the right one top and bottom.
C-bthen%C-bthen" - 08
Split with flags
4 minUse split-window flags from the command prompt to make a full-width bottom pane, a full-height left pane, and one that does not steal focus.
:splitw -fv:splitw -fhb:splitw -d - 09
Move between panes
4 minChange the active pane with the arrow keys, cycle with o, and jump by number with q.
C-bthenUpC-bthenoC-bthenq - 10
Kill the server
3 minShut down every session at once with kill-server, and see why exiting the last shell does the same.
:kill-server - 11
Challenge: morning on the build box
challenge10 minFrom a bare shell, build session work: an editor window, a build window with a full-width log pane, and a monitor window, then detach and come back.