What tmux actually is
Most tutorials start with keybindings. That's backwards — tmux has maybe eight ideas, and once you have the model, the keys become obvious. Here's the model.
The one-sentence version
tmux keeps your terminal work running in a background process (the server), and lets any terminal connect to it, disconnect from it, and split it into as many screens as you want. Terminal crashes, laptop closes, SSH drops — your work doesn't notice.
The hierarchy
One server runs per user, silently, started on demand. It holds sessions (workspaces — one per project is the classic setup). A session holds windows (like browser tabs, listed in the status bar at the bottom). A window holds panes (split terminals you see at the same time). Your terminal is just a client — a viewport that attaches to one session.
server (one, invisible, holds everything)
└── session "work" ← you attach to this
├── window 0: editor ← like a tab
│ ├── pane: nvim
│ └── pane: tests ← splits you see together
└── window 1: server
└── pane: npm run dev
└── session "ops"
└── window 0: ssh prodWhy this design matters
Because the server owns everything, "closing your terminal" and "losing your work" become unrelated events. This is what tmux is *for*. The splits and tabs are nice; detach/reattach is the feature.
The prefix key
Your keystrokes go to the program in the pane — so tmux needs a way to know a key is meant for *it*. That's the prefix: press Ctrl-b, release, then press a command key. Ctrl-b c means "tmux: new window". Every tmux keybinding works this way, and when you see prefix + c written anywhere, that's what it means.
Before moving on
- Install tmux (brew install tmux / apt install tmux)
- Run: tmux new -s hello
- You're in — note the status bar at the bottom
- Type exit to close it again