Terminal GuideTerminal Guide

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.

5 min readLast updated: February 22, 2026
Dai Aoki

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 session
tmux lsList all sessions
tmux attach -t nameAttach to a named session
tmux kill-session -t nameKill a named session
tmux kill-serverKill the tmux server and all sessions

Session Key Bindings

prefix + dDetach from current session
prefix + sList and select sessions
prefix + $Rename current session
prefix + (Switch to previous session
prefix + )Switch to next session

Window Key Bindings

prefix + cCreate a new window
prefix + nMove to next window
prefix + pMove to previous window
prefix + 0-9Select window by number
prefix + wList all windows
prefix + ,Rename current window
prefix + &Close current window (confirm)

Pane Key Bindings

prefix + %Split pane vertically
prefix + "Split pane horizontally
prefix + arrowNavigate between panes
prefix + zToggle pane zoom (fullscreen)
prefix + xClose current pane (confirm)
prefix + oCycle to next pane
prefix + SpaceRotate through pane layouts
prefix + !Break pane into a new window
prefix + Ctrl+arrowResize pane in direction

Copy Mode

prefix + [Enter copy mode
qExit copy mode
SpaceStart selection (vi mode)
EnterCopy selection (vi mode)
prefix + ]Paste from buffer
/Search forward in copy mode
?Search backward in copy mode

Command Line Shortcuts

tmux split-window -hSplit current pane vertically
tmux split-window -vSplit current pane horizontally
tmux select-pane -t NSelect pane by index
tmux resize-pane -D/U/L/R NResize pane by N cells
tmux list-keysList all key bindings

Downloadable Image Preview

Failed to generate 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.

bash
# 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-server

Session 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.

bash
# 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 session

Window 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.

bash
# 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.

bash
# 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 window

Copy 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.

bash
# 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
q

Command 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.

bash
# 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" Enter

Customization 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:

bash
# Change prefix from Ctrl+b to Ctrl+a
unbind C-b
set -g prefix C-a
bind C-a send-prefix

Other popular customizations include enabling mouse support and setting vi mode for copy mode:

bash
# 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 10

View 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