Coral

tmux cheat sheet

The keys you use every day, checked against tmux itself. Pick your prefix, search, click a command to copy it.

Prefix
Copy mode keys
Keyboard

Sessions

Do thisKeysOr run
New sessionNo key
List sessionsCtrl bthens
Attach to a sessionNo key
Attach to the last sessionNo key
Attach, or create it if it isn’t thereNo key
Detach (the session keeps running)Ctrl bthend
Rename sessionCtrl bthen$
Next / previous sessionCtrl bthen)/(Key only
Last sessionCtrl bthenLKey only
Kill a sessionNo key
Kill every sessionNo key

Windows

Do thisKeysOr run
New windowCtrl bthenc
Rename windowCtrl bthen,
Next / previous windowCtrl bthenn/pKey only
Go to window 0 to 9Ctrl bthen0to9Key only
Last windowCtrl bthenlKey only
Pick a window from a listCtrl bthenwKey only
Find a window by textCtrl bthenfKey only
Close windowCtrl bthen&

Panes

Do thisKeysOr run
Split left and rightCtrl bthen%
Split top and bottomCtrl bthen"
Move between panesCtrl bthen↑/↓/←/→Key only
Next paneCtrl bthenoKey only
Last paneCtrl bthen;Key only
Zoom pane to full window, and backCtrl bthenzKey only
Resize pane by 5Ctrl bthenOption ↑/Option ↓/Option ←/Option →
Swap with the pane before / afterCtrl bthen{/}Key only
Show pane numbersCtrl bthenqKey only
Move pane to its own windowCtrl bthen!Key only
Next layoutCtrl bthenSpaceKey only
Even grid layoutCtrl bthenOption 5
Close paneCtrl bthenx

Scroll, search and copy

Once you’re in copy mode, keys work without the prefix.

Do thisKeysOr run
Scroll up (enter copy mode)Ctrl bthen[Key only
Scroll up a page right awayCtrl bthenPage UpKey only
Leave copy modeqKey only
Page up / downPage Up/Page DownKey only
Top / bottom of historyg/GKey only
Search down / up//?Key only
Next / previous matchn/NKey only
Start selectingSpaceKey only
Copy the selectionEnterKey only
Block selection on / offvKey only
PasteCtrl bthen]Key only

Everything else

Do thisKeysOr run
List every keyCtrl bthen?
Type a tmux commandCtrl bthen:Key only
Reload your configNo key
Send the prefix key itselfCtrl btwiceKey only
Big clockCtrl bthentKey only

Make your tmux.conf

Uses the prefix you picked above.

# ~/.tmux.conf · from usecoral.app/tools/tmux-cheat-sheet

# mouse on
set -g mouse on

# number windows from 1
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on

# keep 50,000 lines of scrollback
set -g history-limit 50000

# no delay after esc
set -s escape-time 10

# vi keys in copy mode
setw -g mode-keys vi

Save it as ~/.tmux.conf, then run tmux source-file ~/.tmux.conf or start a new session.

Questions

How do I scroll up in tmux?

Press Ctrl b then [ to enter copy mode, then use the arrow keys or Page Up. Press q to leave. Ctrl b then Page Up jumps in and scrolls a page at once. With set -g mouse on, the scroll wheel works too.

How do I list, attach and kill tmux sessions?

tmux ls lists them. tmux attach -t name attaches, and tmux a attaches to the last one. tmux kill-session -t name ends one, and tmux kill-server ends them all.

How do I split a pane in tmux?

Ctrl b then % splits left and right. Ctrl b then " splits top and bottom. Ctrl b and an arrow key moves between panes, and Ctrl b then x closes one.

How do I change the tmux prefix to Ctrl a?

Add three lines to ~/.tmux.conf: unbind C-b, set -g prefix C-a, and bind C-a send-prefix. Then run tmux source-file ~/.tmux.conf.

Why use tmux with Claude Code or Codex?

A session keeps running when you close the terminal or lose SSH, so a long agent run doesn’t die with your laptop lid. Detach with Ctrl b then d, and attach again later from any terminal.

Every key here is a tmux default, checked against tmux list-keys on tmux 3.8. Copy mode uses vi keys when your $EDITOR or $VISUAL contains vi, or with mode-keys vi; otherwise emacs keys.