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 / KeyAction
tmuxStart new session
tmux new -s nameStart named session
tmux lsList sessions
tmux attach -t nameAttach to named session
tmux kill-session -t nameKill named session
tmux kill-serverKill all sessions
Prefix dDetach from session
Prefix $Rename current session
Prefix sList and switch sessions interactively
Prefix ( / )Switch to prev / next session

Advertisement

Windows

KeyAction
Prefix cCreate new window
Prefix ,Rename current window
Prefix &Kill current window (confirm)
Prefix n / pNext / prev window
Prefix 0-9Switch to window by number
Prefix lLast (most recent) window
Prefix wList windows interactively
Prefix .Move window to a number
Prefix fFind window by name

Panes

Splitting

KeyAction
Prefix %Split vertically (side by side)
Prefix "Split horizontally (top/bottom)
KeyAction
Prefix ArrowMove to pane in direction
Prefix h/j/k/lMove (if vim-style binding set)
Prefix qShow pane numbers, press number to jump
Prefix oCycle through panes
Prefix ;Last active pane

Resizing

KeyAction
Prefix Ctrl+ArrowResize pane by 1
Prefix Alt+ArrowResize pane by 5
Prefix zToggle pane fullscreen (zoom)

Managing

KeyAction
Prefix xKill current pane
Prefix !Break pane into new window
Prefix { / }Swap pane with prev / next
Prefix SpaceCycle pane layouts

Copy Mode

KeyAction
Prefix [Enter copy mode
q or EscExit copy mode
SpaceStart selection (default bindings)
EnterCopy 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):

KeyAction
h/j/k/lMove cursor
vBegin selection
yCopy selection
Ctrl+u / Ctrl+dHalf page up / down
/ / ?Search forward / backward
n / NNext / prev search match

Advertisement

Command Mode

KeyAction
Prefix :Enter command prompt
:new-windowNew window
:kill-paneKill pane
:source-file ~/.tmux.confReload config
:list-keysShow all key bindings
:list-commandsShow all commands

.tmux.conf Essentials

# 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

# 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