tmux is a terminal multiplexer. Start by distinguishing Session, Window, Pane and Client, then learn why the default prefix comes before each shortcut.
§ 00 · tmux — splitting terminals and reconnecting to them
tmux is a terminal multiplexer that lets you run several terminal programs inside one terminal. Place different programs—shells, editors, servers and AI coding tools—in separate Windows and Panes, and switch between them on one screen.
Even if you close the outer terminal or lose a remote connection, processes inside tmux can keep running while the tmux server remains alive. It is not permanent storage that survives a computer restart, termination of the tmux server or the closing of every Session. Each program, rather than tmux, also determines whether conversation history is saved.
§ 01 · From Server to Pane — distinguish the four layers
The tmux server manages Sessions and the state of the programs inside them in the background. A Client is the connection from an outer terminal that attaches a particular Session to the screen. A Session contains several Windows, and a Window contains one or more Panes.
A Window is similar to a browser tab. The current Window fills the screen, and you switch Windows by number or name. A Pane is a rectangular subdivision of that Window. Keyboard input goes to the single active Pane in the current Window.
| Term | Function | Analogy |
|---|---|---|
| Server | The background process managing all Sessions and their running state | A building management office |
| Client | The display and input attached to a Session from an outer terminal | A building entrance |
| Session | A unit of work grouping several Windows | A workbench for one project |
| Window | A screen containing one or more Panes, selected by number or name | A browser tab |
| Pane | A rectangular area displaying one actual terminal program | One section of a split screen |
§ 02 · Prefix — press Ctrl-b, then the command key
The default prefix is C-b: hold Ctrl and press b. Most tmux shortcuts have two stages: press C-b, release it, then press the next key. For C-b c, you do not press Ctrl-b and c together; send the prefix first, then press c.
The prefix tells tmux to receive the next key instead of passing it to the shell or running program. All shortcuts in this article use the defaults. If you changed the prefix or key bindings in your configuration file, your actual settings take precedence. C-b ? opens the current list of keys.
Read this note at sass.studio.