The tmux prefix key explained

ยทcheatly.dev

Every tmux shortcut starts with a prefix key โ€” by default, Ctrl-b. It's not a chord you hold down. It's a two-step sequence: press Ctrl-b, release it, then press the next key. Like knocking before entering.

This trips up every beginner. You press Ctrl-b and % at the same time โ€” nothing happens. The prefix is a separate keystroke. Press it, let go, then press the command key within a short window (500ms by default).

Why does the prefix exist?

Without it, tmux couldn't tell the difference between "I want to type the letter d" and "I want to detach from this session." The prefix creates a namespace โ€” everything after it is a tmux command, everything without it goes to your shell.

The most common prefix commands

After pressing Ctrl-b
%
Split pane vertically
"
Split pane horizontally
d
Detach from session
c
Create new window
n
Next window
z
Zoom current pane (toggle)
x
Close current pane

Changing the prefix

Ctrl-b is awkward โ€” your fingers have to stretch. Most people remap it. The two popular alternatives:

Ctrl-a (classic, from GNU Screen):

set -g prefix C-a
unbind C-b
bind C-a send-prefix

Ctrl-Space (comfortable, rarely conflicts):

set -g prefix C-Space
unbind C-b
bind C-Space send-prefix

Add either to your ~/.tmux.conf and reload with tmux source-file ~/.tmux.conf.

The bind ... send-prefix line lets you send the actual prefix keystroke to programs inside tmux. Without it, pressing your prefix inside a nested tmux session won't work.

Adjusting the timeout

If tmux feels sluggish after pressing the prefix, the repeat-time setting controls how long it waits for the next key:

set -g repeat-time 300

Lower values (200-300ms) feel snappier. The default is 500ms.

For the full reference, see our tmux cheatsheet. Want to build your config visually? Try the tmux config editor.