The tmux prefix key is Ctrl+b by default. You press this key combination before any tmux command to tell tmux that the following keystroke is a command, not input for your application.
Ctrl+b <key>
In tmux, the prefix key acts as a signal that the next keystroke should be interpreted as a tmux command rather than being passed through to your terminal application. This mechanism is necessary because tmux runs on top of your terminal and needs a way to distinguish between regular input and tmux-specific commands.
Many users find Ctrl+b awkward and prefer to change it. A popular alternative is Ctrl+a (same as GNU Screen). To change it, add these lines to your ~/.tmux.conf
:
# Remap prefix from 'C-b' to 'C-a' unbind C-b set-option -g prefix C-a bind-key C-a send-prefix
You can create a "prefix-less" environment for frequently used commands by mapping them directly to non-prefixed key combinations:
# Switch windows without prefix bind -n M-Left previous-window bind -n M-Right next-window
Pressing the prefix key twice (e.g., Ctrl+b Ctrl+b) will send the prefix to the application running inside tmux. This is useful when working with nested tmux sessions or applications that also use the prefix key.