Prefix Key and Keybindings
The prefix key is the gateway to every tmux command. Building muscle memory for the key bindings is the single most valuable tmux skill.
Every tmux shortcut = prefix + command key. The default prefix is Ctrl+b. You must press and release the prefix before the command key.
How the Prefix Works
Step 1: Press Ctrl+b (press and release)
Step 2: Press d (detach)
This is NOT the same as Ctrl+b+d (all pressed simultaneously). Many beginners make this mistake.
Hold Ctrl+b, release, then press the command key. Do not hold all keys simultaneously.
This server uses Ctrl+Space as prefix (instead of Ctrl+b). All default prefix bindings still work — just replace Ctrl+b with Ctrl+Space. The tables below show both columns side by side.
Additionally, these prefix-free shortcuts are available (no prefix key needed):
| Default | Prefix-Free Alternative | Action |
|---|---|---|
Ctrl+b arrows | Alt+arrows | Navigate panes |
Ctrl+b arrows | Alt+h/j/k/l | Navigate panes (vim-style) |
Ctrl+b z | Alt+z | Toggle zoom |
Ctrl+b n/p | Alt+PageDown/Up | Next/previous window |
Ctrl+b 1/2/3 | Alt+1/2/3 | Jump to window 1/2/3 |
Ctrl+b (/ ) | Alt+Home/End | Previous/next session |
The Complete Key Binding Reference
Session Management
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b d | Ctrl+Space d | Detach from session |
Ctrl+b s | Ctrl+Space s | List / switch sessions (interactive overview) |
Ctrl+b $ | Prefix e s | Rename current session |
Ctrl+b ( | Alt+Home | Previous session |
Ctrl+b ) | Alt+End | Next session |
Window Management
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b c | Ctrl+Space W | Create new window |
Ctrl+b , | Prefix e w | Rename current window |
Ctrl+b n | Alt+PageDown | Next window |
Ctrl+b p | Alt+PageUp | Previous window |
Ctrl+b l | Ctrl+Space l | Last (previously active) window |
Ctrl+b 0-9 | Alt+1/2/3 or Ctrl+Space 0-9 | Jump to window by number |
Ctrl+b w | Ctrl+Space w | Searchable session/window/pane tree |
Ctrl+b & | Ctrl+Space X | Kill current window (with confirm) |
Ctrl+b . | Ctrl+Space . | Move window to new index |
Use Ctrl+b w as the primary navigator. It opens the tree for sessions, windows, and panes; press / inside the chooser to search/filter, then Enter to switch.
Keep Ctrl+b s for a simple session overview unless you specifically want a dedicated session-only chooser.
Pane Management
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b % | `Ctrl+Space | ` |
Ctrl+b " | Ctrl+Space - | Split pane horizontally |
Ctrl+b arrow | Alt+arrows or Alt+h/j/k/l | Navigate panes |
Ctrl+b o | Ctrl+Space o | Cycle through panes |
Ctrl+b ; | Ctrl+Space ; | Last active pane |
Ctrl+b q | Ctrl+Space q | Show pane numbers |
Ctrl+b z | Ctrl+Space z | Zoom/unzoom current pane (with prefix) |
Alt+z | Alt+z | Zoom/unzoom current pane (no prefix) |
Ctrl+b ! | Ctrl+Space ! | Break pane into new window |
Ctrl+b x | Ctrl+Space x | Kill current pane (with confirm) |
Ctrl+b { | Prefix S Left/h | Move pane left |
Ctrl+b } | Prefix S Right/l | Move pane right |
Ctrl+b Space | Ctrl+Space Space | Cycle through layouts |
Ctrl+b Alt+arrow | Ctrl+Space Alt+arrow | Resize pane |
Copy Mode and Scrollback
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b [ | Ctrl+Space [ | Enter copy/scroll mode |
Ctrl+b ] | Ctrl+Space ] | Paste from tmux buffer |
Ctrl+b = | Ctrl+Space = | Choose paste buffer |
Ctrl+b # | Ctrl+Space # | List paste buffers |
Ctrl+b PgUp | Ctrl+Space PgUp | Enter copy mode and scroll up |
Miscellaneous
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b : | Ctrl+Space : | Open command prompt |
Ctrl+b ? | Ctrl+Space ? | Show all key bindings |
Ctrl+b t | Ctrl+Space t | Show clock (press q to exit) |
Ctrl+b ~ | Ctrl+Space ~ | Show messages |
Ctrl+b r | Ctrl+Space r | Reload config (if bound in config) |
Changing the Prefix Key
Many users change the prefix to Ctrl+a (like GNU Screen):
# Unbind default prefix
unbind C-b
# Set new prefix
set -g prefix C-a
bind C-a send-prefix
Ctrl+a is easier to type, but conflicts with shell line-start shortcut on many terminals. Consider Ctrl+Space or Ctrl+\ as alternatives.
Creating Custom Key Bindings
# reload config with prefix + r
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# easy pane splits with | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# vim-style pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# resize panes with vim-style keys
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
The -r flag makes the key repeatable — you can press it multiple times without re-pressing the prefix.
Listing Current Key Bindings
| Default Shortcut | Modification Shortcut | Action |
|---|---|---|
Ctrl+b ? | Ctrl+Space ? | Show all key bindings |
From the command line:
tmux list-keys
Removing a Key Binding
unbind C-b # remove Ctrl+b default prefix
unbind '"' # remove horizontal split default
Key Binding Recommendation for Beginners
Add these to your ~/.tmux.conf to make tmux far more pleasant:
# Easier prefix
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Intuitive splits (remembers current path)
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Vim-style navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Reload config
bind r source-file ~/.tmux.conf \; display "Reloaded!"