Tmux Cheatsheet
Comprehensive Tmux cheatsheet covering sessions, windows, panes, copy mode, and .tmux.conf configuration. Default prefix is Ctrl+b.
Updated September 15, 2026
tmuxterminalmultiplexerlinux
Default prefix:
Ctrl+b. All key bindings below require pressing prefix first, then the key.
Sessions
| Command / Key | Action |
|---|---|
tmux | Start new session |
tmux new -s name | Start named session |
tmux ls | List sessions |
tmux attach -t name | Attach to named session |
tmux kill-session -t name | Kill named session |
tmux kill-server | Kill all sessions |
Prefix d | Detach from session |
Prefix $ | Rename current session |
Prefix s | List and switch sessions interactively |
Prefix ( / ) | Switch to prev / next session |
Advertisement
Windows
| Key | Action |
|---|---|
Prefix c | Create new window |
Prefix , | Rename current window |
Prefix & | Kill current window (confirm) |
Prefix n / p | Next / prev window |
Prefix 0-9 | Switch to window by number |
Prefix l | Last (most recent) window |
Prefix w | List windows interactively |
Prefix . | Move window to a number |
Prefix f | Find window by name |
Panes
Splitting
| Key | Action |
|---|---|
Prefix % | Split vertically (side by side) |
Prefix " | Split horizontally (top/bottom) |
Navigating
| Key | Action |
|---|---|
Prefix Arrow | Move to pane in direction |
Prefix h/j/k/l | Move (if vim-style binding set) |
Prefix q | Show pane numbers, press number to jump |
Prefix o | Cycle through panes |
Prefix ; | Last active pane |
Resizing
| Key | Action |
|---|---|
Prefix Ctrl+Arrow | Resize pane by 1 |
Prefix Alt+Arrow | Resize pane by 5 |
Prefix z | Toggle pane fullscreen (zoom) |
Managing
| Key | Action |
|---|---|
Prefix x | Kill current pane |
Prefix ! | Break pane into new window |
Prefix { / } | Swap pane with prev / next |
Prefix Space | Cycle pane layouts |
Copy Mode
| Key | Action |
|---|---|
Prefix [ | Enter copy mode |
q or Esc | Exit copy mode |
Space | Start selection (default bindings) |
Enter | Copy selection and exit |
Prefix ] | Paste from tmux buffer |
Prefix = | Choose paste buffer from list |
With vi keys in copy mode (requires setw -g mode-keys vi in config):
| Key | Action |
|---|---|
h/j/k/l | Move cursor |
v | Begin selection |
y | Copy selection |
Ctrl+u / Ctrl+d | Half page up / down |
/ / ? | Search forward / backward |
n / N | Next / prev search match |
Advertisement
Command Mode
| Key | Action |
|---|---|
Prefix : | Enter command prompt |
:new-window | New window |
:kill-pane | Kill pane |
:source-file ~/.tmux.conf | Reload config |
:list-keys | Show all key bindings |
:list-commands | Show all commands |
.tmux.conf Essentials
bash
# Change prefix to Ctrl+a (screen-style)
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Vi mode in copy mode
setw -g mode-keys vi
# Mouse support
set -g mouse on
# Start windows and panes at 1
set -g base-index 1
setw -g pane-base-index 1
# Faster key repetition
set -s escape-time 0
# Reload config shortcut
bind r source-file ~/.tmux.conf \; display "Config reloaded"
# Better splits (open in current path)
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
# Status bar
set -g status-bg black
set -g status-fg white
set -g status-interval 1
set -g status-right "%H:%M %d-%b-%y"
# Bigger scrollback buffer
set -g history-limit 50000
Scripting Sessions
bash
# Create detached session with windows
tmux new-session -d -s myapp -n editor
tmux new-window -t myapp -n server
tmux new-window -t myapp -n logs
# Send commands to a pane
tmux send-keys -t myapp:editor "vim ." Enter
tmux send-keys -t myapp:server "npm run dev" Enter
# Attach
tmux attach -t myapp