All interaction with tmux goes through the prefix, so this is the first thing to get into your fingers.
tmux sits between your terminal and the programs running in it. To tell tmux that a keystroke is meant for it, not for the shell or editor inside, you first press the prefix: Ctrl-b by default. Release it, then press the command key. In docs this is written C-b d, meaning "press Ctrl-b, then d".
Three keys to learn first:
C-b ?lists every key binding (pressqto leave the list).C-b :opens the command prompt at the bottom, where you can type any tmux command, such asnew-windoworkill-session. Tab completes command names.C-b ddetaches from tmux, leaving everything running.
Everything you can do with a key binding is really a tmux command; the keys are just shortcuts. The same commands can be run from the shell, tmux new-window, or from the config file. That uniformity is what makes tmux scriptable later.
If you need to send a literal Ctrl-b to the program inside (for example to page up in less or vim), press C-b C-b. Many people move the prefix to Ctrl-a or Ctrl-Space in their config; the configuration lesson shows how.
Example
tmux # start tmux (creates a session and attaches)
# inside tmux:
# C-b ? list key bindings (q to quit the list)
# C-b : command prompt, e.g. type: new-window -n logs
# C-b d detach; programs keep running
tmux list-keys | head -5 # same bindings, from the shell
tmux list-commands | wc -l # every command tmux understandsRemember
- Prefix (C-b) first, then the command key
- C-b ? lists bindings, C-b : opens the command prompt
- Every key binding is just a tmux command
Watch out for
- Holding Ctrl while pressing the second key (C-b C-d) instead of releasing it; that is a different binding.