tmux Cheat Sheet
Sessions, windows, panes, copy mode, and config in one quick reference.
prefix is Ctrl+b by defaultPress it, let go, then press the key.
/
Sessions
tmux | start new session |
tmux new -s name | start named session |
tmux ls | list sessions |
tmux attach -t name | attach to session |
tmux kill-session -t name | kill session |
| prefix$ | rename session |
| prefixd | detach |
| prefixs | list/switch sessions |
| prefix( | previous session |
| prefix) | next session |
Windows
| prefixc | new window |
| prefix, | rename window |
| prefix& | kill window |
| prefixn | next window |
| prefixp | previous window |
| prefix09 | switch to window number |
| prefixw | list windows |
| prefixf | find window |
| prefix. | move window |
Copy mode
| prefix[ | enter copy mode |
| Space | start select |
| Enter | copy selection |
| prefix] | paste |
| q | quit |
| / | search forward |
| ? | search backward |
| n/N | next / previous hit |
Panes
| prefix% | split vertical |
| prefix" | split horizontal |
| prefixx | kill pane |
| prefixz | zoom/unzoom pane |
| prefix← ↑ ↓ → | navigate panes |
| prefixo | cycle panes |
| prefix; | last active pane |
| prefix{ | move pane left |
| prefix} | move pane right |
| prefix! | break pane to window |
| prefixq | show pane numbers |
| prefixCtrl← ↑ ↓ → | resize pane |
| prefixSpace | cycle layouts |
Command line
| prefix: | open prompt |
:new-window | new window |
:split-window -h | split horizontal |
:split-window -v | split vertical |
:resize-pane -D 10 | resize pane down 10 rows |
:setw synchronize-panes on | type into all panes at once |
:set -g mouse on | enable mouse support |
Misc / useful
| prefix? | list all keybindings |
| prefixt | show clock |
| prefix~ | show messages |
| prefixi | window info |
| prefixr | reload config* |
* add to ~/.tmux.conf: bind r source ~/.tmux.conf
Nothing matches “”
Try a verb like split, rename, or kill, or a key like z.
A good starting .tmux.conf
~/.tmux.conf
set -g mouse on# enable mouse supportset -g history-limit 10000# increase scrollback bufferset -g base-index 1# start windows at 1setw -g mode-keys vi# use vi keys in copy modeset -g default-terminal "screen-256color"# 256 color supportset -sg escape-time 0# no delay for escape keyset -g status-right "%H:%M %d-%b-%y"# clock in status barbind r source ~/.tmux.conf# reload with prefix + r
Prefer Ctrl + a? Add set -g prefix C-a and unbind C-b.