tmux Cheat Sheet: All Key Bindings & Commands
Complete tmux cheat sheet with all keyboard shortcuts, commands, and quick reference tables for sessions, windows, panes, and copy mode.
Dai Aoki
CEO at init, Inc. / CTO at US & JP startups / Creator of WebTerm
Quick Reference
Session Commands (CLI)
tmux new -s nameCreate a new named sessiontmux lsList all sessionstmux attach -t nameAttach to a named sessiontmux kill-session -t nameKill a named sessiontmux kill-serverKill the tmux server and all sessionsSession Key Bindings
prefix + dDetach from current sessionprefix + sList and select sessionsprefix + $Rename current sessionprefix + (Switch to previous sessionprefix + )Switch to next sessionWindow Key Bindings
prefix + cCreate a new windowprefix + nMove to next windowprefix + pMove to previous windowprefix + 0-9Select window by numberprefix + wList all windowsprefix + ,Rename current windowprefix + &Close current window (confirm)Pane Key Bindings
prefix + %Split pane verticallyprefix + "Split pane horizontallyprefix + arrowNavigate between panesprefix + zToggle pane zoom (fullscreen)prefix + xClose current pane (confirm)prefix + oCycle to next paneprefix + SpaceRotate through pane layoutsprefix + !Break pane into a new windowprefix + Ctrl+arrowResize pane in directionCopy Mode
prefix + [Enter copy modeqExit copy modeSpaceStart selection (vi mode)EnterCopy selection (vi mode)prefix + ]Paste from buffer/Search forward in copy mode?Search backward in copy modeCommand Line Shortcuts
tmux split-window -hSplit current pane verticallytmux split-window -vSplit current pane horizontallytmux select-pane -t NSelect pane by indextmux resize-pane -D/U/L/R NResize pane by N cellstmux list-keysList all key bindingsDownloadable Image Preview
Session Commands (CLI)
These commands are run directly from the shell to manage tmux sessions. The default prefix key is Ctrl+b, which must be pressed before any key binding inside tmux.
# Create a new session with a name
tmux new -s my-project
# Create a new session and start in a specific directory
tmux new -s work -c ~/projects
# List all active sessions
tmux ls
# Attach to an existing session by name
tmux attach -t my-project
# Attach to the most recently used session
tmux attach
# Kill a specific session
tmux kill-session -t my-project
# Kill all sessions and the tmux server
tmux kill-serverSession Key Bindings
These bindings work inside tmux after pressing the prefix key (Ctrl+b by default). Sessions let you group related windows together and switch between different projects.
# Detach from the current session (returns to shell)
prefix + d
# List all sessions and switch interactively
prefix + s
# Rename the current session
prefix + $
# Navigate between sessions
prefix + ( # Previous session
prefix + ) # Next sessionWindow Key Bindings
Windows in tmux are similar to tabs in a web browser. Each window occupies the full terminal screen and can contain multiple panes.
# Create a new window
prefix + c
# Navigate between windows
prefix + n # Next window
prefix + p # Previous window
prefix + 0-9 # Jump to window by number
# List all windows and select interactively
prefix + w
# Rename the current window
prefix + ,
# Close the current window (with confirmation)
prefix + &Pane Key Bindings
Panes let you split a single window into multiple sections, each running its own shell. This is one of the most powerful features of tmux.
# Split panes
prefix + % # Vertical split (left/right)
prefix + " # Horizontal split (top/bottom)
# Navigate between panes
prefix + arrow key # Move in direction of arrow
prefix + o # Cycle to the next pane
# Resize panes
prefix + Ctrl+arrow # Resize in direction of arrow
# Zoom and layout
prefix + z # Toggle zoom (fullscreen current pane)
prefix + Space # Cycle through pane layouts
# Manage panes
prefix + x # Close current pane (with confirmation)
prefix + ! # Break pane into its own windowCopy Mode
Copy mode allows you to scroll through terminal output, search for text, and copy content to the tmux paste buffer. The default key bindings use emacs-style keys, but vi-style bindings are commonly preferred and can be enabled with setw -g mode-keys vi in your tmux.conf.
# Enter copy mode
prefix + [
# Navigation in copy mode (vi mode)
h, j, k, l # Move cursor
Ctrl+u # Page up
Ctrl+d # Page down
g # Go to top
G # Go to bottom
# Selection and copying (vi mode)
Space # Start selection
Enter # Copy selection and exit copy mode
Escape # Clear selection
# Search in copy mode
/ # Search forward
? # Search backward
n # Next search match
N # Previous search match
# Paste
prefix + ] # Paste most recent buffer
# Exit copy mode
qCommand Line Shortcuts
These commands can be run from an external shell or from the tmux command prompt (prefix + :). They are useful for scripting and automation.
# Split panes from the command line
tmux split-window -h # Vertical split
tmux split-window -v # Horizontal split
# Select a specific pane
tmux select-pane -t 0 # Select pane 0
tmux select-pane -t 1 # Select pane 1
# Resize panes
tmux resize-pane -D 5 # Resize down by 5 cells
tmux resize-pane -U 5 # Resize up by 5 cells
tmux resize-pane -L 10 # Resize left by 10 cells
tmux resize-pane -R 10 # Resize right by 10 cells
# List all current key bindings
tmux list-keys
# Send keys to a specific pane (useful for scripting)
tmux send-keys -t 0 "ls -la" EnterCustomization Tips
The default prefix key Ctrl+b can be awkward to press frequently. Many users remap it to Ctrl+a, which is easier to reach and familiar to GNU Screen users. Add the following to your ~/.tmux.conf to change the prefix key:
# Change prefix from Ctrl+b to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefixOther popular customizations include enabling mouse support and setting vi mode for copy mode:
# Enable mouse support (scrolling, pane selection, resizing)
set -g mouse on
# Use vi-style key bindings in copy mode
setw -g mode-keys vi
# Start window numbering from 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# Reduce escape time delay (useful for vim users)
set -sg escape-time 10View All Key Bindings
Press prefix + ? inside any tmux session to view a complete list of all currently active key bindings. This is especially useful after adding custom bindings to your tmux.conf, as it reflects your actual configuration including any overrides or additions you have made.
Official Documentation
For authoritative information, refer to the official documentation:
Related Articles
tmux - Terminal Multiplexer
Terminal multiplexer for session management and window splitting
tmux Split Window & Pane Management Guide
Master tmux split windows and pane management. Learn horizontal and vertical splits, pane navigation, resizing, layouts, zoom, synchronized input, and practical workflows.
tmux Session Management: Complete Guide
Complete guide to tmux session management. Learn how to create, attach, detach, list, and organize sessions for efficient terminal workflows.
tmux.conf Configuration Guide: Customize Your tmux
Complete tmux.conf configuration guide. Learn prefix key customization, key bindings, status bar styling, mouse settings, true color, performance tuning, and workflow-specific configs.
tmux Copy Mode: Copy, Paste & Clipboard Guide
Master tmux copy mode for copying text, searching, and clipboard integration. Covers vi and emacs modes, system clipboard setup for macOS and Linux, and buffer management.