tmux lab
Learn tmux by doing in a simulated tmux in the page — the real default keys, splits, layouts, zoom, windows, sessions, copy mode in vi or emacs keys, the command prompt, detach and attach — plus a .tmux.conf builder that explains every line, a live status-line preview, a layout-string decoder and encoder with the checksum, a searchable cheat sheet and how cmux compares.
Added
How to use it
tmux is one of those tools where reading the manual doesn’t help until your fingers know the keys. This page is a tmux you can’t break: press the keys and watch what happens, with each key’s command explained as you go.
How to use it
Lab — click the terminal and use the keyboard. The prefix is C-b (Control and b together, let
go, then the key). Every default binding of tmux 3.6a is there, because I took them from a real
tmux’s list-keys: % and " split, the arrows and o move between panes, C-arrow and
M-arrow resize (hold them: they repeat), z zooms, Space and M-1…M-7 change the layout,
{ } swap panes, ! breaks a pane out into a window, x closes it after asking, c n p
0–9 l , & work with windows, $ ( ) s w with sessions, d detaches (then type
tmux attach), : opens the command prompt, [ enters copy mode and ] pastes, ? lists the
keys, q numbers the panes and t shows the clock.
Copy mode follows mode-keys: emacs keys by default (C-Space to start a selection, M-w to copy)
or vi (Space, v for a rectangle, Enter), with searching (/, ?, n), jumps (f, t) and
word and paragraph moves. The panes run a pretend shell: help lists what it knows, seq 1 100
gives you something to scroll, and tmux … runs a tmux command, as it would in a real pane. The
command prompt takes the common commands — split-window -h -l 30%, select-layout tiled,
resize-pane -R 10, setw synchronize-panes on, new -s work, bind, set and the rest. On a
phone, use the key buttons and the text box under the terminal.
The Learn by doing list on the right ticks off each skill as you use it.
.tmux.conf — tick the usual tweaks (prefix C-a, mouse, windows from 1, splits in the current
directory, vi copy keys, r to reload, no Escape delay, true colour…) or paste your own config.
Every line is explained, unknown options are flagged, and rebinding a default key says what it
replaces. Apply to the lab runs the file in the simulator, so you can try your keys before
copying the file home. The status line section previews status-left, status-right and the
window formats as you type, with {?…} conditionals, {=N:…} truncation, #[fg=…] colours
and %H:%M times.
Layout strings — paste a #{window_layout} string such as 5468,159x48,0,0{79x48,0,0,1,79x48,80,0,2}:
it checks the checksum (and gives the right one), draws the panes and explains the tree. Make
one gives the string select-layout would produce for a number of panes and a window size.
Cheat sheet — every default binding in the prefix, copy-mode-vi, copy-mode and root tables, searchable, with tmux’s own descriptions, and the shell commands I use most.
cmux — what cmux is (a macOS terminal for running several coding agents side by side, built on libghostty) and how its shortcuts, configuration and CLI compare with tmux, from its documentation.
How close to tmux it is
The key tables and option defaults were captured from tmux 3.6a started with -f /dev/null. The
layout arithmetic follows tmux’s layout.c and layout-set.c: I captured 147 layouts from a real
tmux (every built-in layout for one to seven panes at 200×50, 80×24 and 120×40) and a sequence of
splits, sizes in cells and percent, resizes, a kill and a swap; the lab produces the same layout
strings, checksums included. Pane movement with the arrows, the -r repeat time, synchronize-panes,
paste buffers and the command parser (quotes, \; in bindings, { } blocks) behave like tmux.
What it doesn’t do: run programs (the shell is canned, and #(…) in formats or run-shell don’t
run), the mouse, menus, popups, hooks, plugins, multiple clients, and the rarer commands and copy-mode
commands — it says so when you use one.
Browser support
Any current browser. Some browsers keep a few Ctrl and Alt combinations for themselves; the key buttons under the terminal always work.
Privacy
Everything runs in this page. Your config, the layout you’re decoding and your lesson progress are kept in this browser’s local storage; nothing is uploaded.
Related: Linux shell, bash explainer, git trainer, server config for SSH, Makefile explainer.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.