tmux Cheatsheet

Troubleshooting

Use this tmux reference while you build software engineering projects, review code, or refresh the syntax you reach for most.

Troubleshooting

SymptomCause and fix
no server running on /tmp/tmux-1000/defaultNothing is running. Start with tmux new.
sessions should be nested with careYou are already inside tmux. Use switch-client, not attach.
duplicate session: nameIt exists. attach -t name instead of new -s name.
Esc lags in Vimset -sg escape-time 10
Colors wrong inside tmuxdefault-terminal "tmux-256color" plus a terminal-overrides Tc entry
Window shrinks to the smallest clientsetw -g aggressive-resize on, or detach the other client with attach -d
Mouse selection copies the wrong thingHold Shift to use the terminal's own selection instead of tmux's
Clipboard does nothingSet up copy-pipe-and-conflict for your platform, or set -g set-clipboard on
$PATH or $EDITOR stale in new panesThe server has an old environment. tmux set-environment, or update-environment
Window keeps renaming itselfset -g allow-rename off
Config change had no effecttmux source-file ~/.tmux.conf, and check show-options -g for the real name
Option name rejectedIt was renamed in a newer version. Check tmux -V against the manual.
Panes disappear after reboottmux is not persistent across reboots. Use resurrect plus continuum.
Prefix key does nothingAnother program grabbed it, or your config errored out. Run tmux list-keys to confirm it loaded.
tmux -vv new -s debug        # write a verbose server log to the cwd
tmux info                    # server, client, and terminal diagnostics
tmux list-keys | less        # what is actually bound
tmux show-options -g | less  # what is actually set
tmux kill-server             # start clean

When a config line fails, tmux prints the error and stops reading the file, so everything after that line is silently skipped. That is why "my config partly works" almost always means one bad line near the top.

tmux vs screen vs Zellij

tmuxGNU screenZellij
PanesYes, first classYes, awkwardYes
ScriptingFull command APILimitedYes, plus layouts as KDL
Config formattmux.conf commands.screenrcKDL
Discoverabilityprefix ?SparseOn-screen hints by default
UbiquityAlmost everywhereEverywhere, older boxesRare, install it yourself
Default prefixCtrl-bCtrl-aCtrl-p/Ctrl-t modes

Learn tmux because it is what is installed on the server you inherit. Zellij is friendlier for beginners, and screen is the fallback on very old systems where only screen exists.

Alternatives Inside a Terminal

Modern terminal emulators (WezTerm, kitty, Alacritty with a WM, iTerm2) all do splits and tabs natively, and they are faster because there is no extra process in the pipe. What they do not do is survive a dropped SSH connection or a closed terminal, because the shells are children of the GUI app.

The practical split most people land on:

  • Emulator splits for local work, where nothing needs to persist.
  • tmux on every remote host, always.

Version Differences

Options get renamed, and a config that works on 3.3 can fail on 2.6. tmux stops reading the file at the first error, so one bad line silently disables everything after it.

tmux -V
VersionChange
1.9default-path removed, use -c on split and new-window
2.1Mouse options merged into a single mouse on
2.4Copy-mode commands moved to send -X, key tables changed
2.6set-clipboard gained OSC 52 support
2.9*-style options replaced the old *-fg / *-bg pairs; new -A added
3.0%if / %endif conditionals in the config
3.1XDG config path, bind -N descriptions
3.2display-popup, terminal-features
# Guard a version-specific option
%if "#{>=:#{version},3.2}"
  set -g terminal-features ",*:usstyle"
%endif
# Or fall back silently on older builds
if-shell -b '[ "$(tmux -V | cut -d" " -f2 | tr -d "a-z")" -ge 29 ]' \
  'set -g status-style bg=colour235' \
  'set -g status-bg colour235'

Reading a Config Error

tmux source-file ~/.tmux.conf
# /Users/me/.tmux.conf:24: unknown option: mouse-select-pane

The line number is exact. Fix that line, re-source, repeat. Everything below line 24 was skipped, which is why "half my config works" is nearly always a single bad line rather than many.

Diagnostics Checklist

tmux -V                       # version, before anything else
tmux info | head -40          # server, terminal, and client details
tmux list-keys | grep <key>   # what a key is actually bound to
tmux show-options -g          # what is actually set globally
tmux show-options -gw         # window options
tmux list-sessions            # is the server even up
echo $TERM                    # inside vs outside tmux
tmux -vv new -s dbg           # verbose server + client logs in the cwd
tmux kill-server              # last resort, start clean

When something behaves differently than the docs say, check tmux -V first and tmux show-options -g <name> second. Between them they explain most surprises.