Tmux

🔗TMUX CHEATSHEET (PREFIX: C-b)

🔗SERVER AND CLIENTS

Command / BindingDescription
tmuxstart new unnamed session
tmux -L <socket> newstart server with isolated custom socket
tmux -S /path/to/sockstart server with specific socket path
tmux kill-serverkill server and all attached sessions
tmux list-clientsshow all connected users/clients
tmux detach-client -adetach all clients except the current one
tmux suspend-clientsuspend the current client
C-b ddetach from current session
C-b Dchoose which client to detach interactively

🔗SESSION MANAGEMENT

Command / BindingDescription
tmux new -s <name>start new named session
tmux new -s <name> -dstart session in background (detached)
tmux new -s <name> -c <dir>start session with specific working directory
tmux new -t <target> -s <name>create grouped session (shared windows)
tmux aattach to most recently used session
tmux a -t <name>attach to named session
tmux a -d -t <name>detach others, then attach to session
tmux lslist active sessions
tmux rename-session -t <old> <new>rename session from cli
tmux kill-session -t <name>kill specific session
tmux kill-session -akill all sessions except current
C-b sinteractive session tree (switch/kill)
C-b $rename current session
C-b ( / C-b )switch to previous / next session
C-b Lswitch to last used session

🔗WINDOW MANAGEMENT

Command / BindingDescription
C-b cnew window (inherits cwd)
C-b ,rename current window
C-b n / C-b pnext / previous window
C-b 1-9go to window by index (base 1)
C-b winteractive window list
C-b &kill window (prompts)
C-b .move window to new index interactively
C-b ffind window by name
tmux new-window -n <name>create named window from cli
tmux select-window -t <name>switch to specific window
tmux move-window -s <src> -t <dst>move window to new index or session
tmux swap-window -s <1> -t <2>swap positions of two windows
tmux link-window -s <src> -t <dst>link window so it appears in two sessions

🔗PANE MOVEMENT AND MANIPULATION

Command / BindingDescription
C-b -split horizontal (pane below, inherits cwd)
C-b |split vertical (pane right, inherits cwd)
C-b h/j/k/lnavigate left/down/up/right
C-b H/J/K/Lresize left/down/up/right by 5 (repeatable)
C-b ztoggle zoom (fullscreen pane)
C-b xkill current pane (prompts)
C-b !break pane out into its own new window
C-b { / C-b }swap pane with previous/next
C-b Spacecycle through layout presets
C-b qshow pane indices (press number to jump)
C-b m / C-b Mmark pane for join/swap operations / clear mark
C-b Stoggle synchronise-panes (send keys to all)
tmux split-window -h -p 30split vertically, new pane takes 30% width
tmux split-window -v -l 20split horizontally, new pane is 20 lines high
tmux split-window -f -hsplit vertically, span full window height
tmux join-pane -s <src> -t <dst>move pane from source window to target window
tmux swap-pane -s <src> -t <dst>swap specific panes
tmux select-layout main-verticalforce specific layout

🔗COPY MODE AND BUFFERS (VI + WAYLAND)

Command / BindingDescription
C-b [enter copy mode
C-b PgUpenter copy mode and scroll up
h, j, k, lnavigate cursor
w, b, eword forward, back, end of word
0, $start of line, end of line
g, Gtop of buffer, bottom of buffer
Ctrl-u, Ctrl-dpage up, page down
/, ?search forward, search backward
n, Nnext match, previous match
vbegin character selection
Vbegin line selection
Ctrl-vtoggle block/rectangle selection
oswap cursor to other end of selection
ycopy to wayland clipboard (wl-copy) & exit
q / Escapeexit copy mode
C-b ]paste from most recent tmux buffer
C-b =choose buffer interactively to paste
C-b -delete most recent buffer
C-b #list all paste buffers
tmux show-bufferprint most recent buffer to stdout
tmux save-buffer <file>write paste buffer to disk
tmux set-buffer "text"inject text into tmux buffer
tmux delete-buffer -b <name>delete specific buffer

🔗OPTIONS AND ENVIRONMENT

Command / BindingDescription
C-b :enter command mode
C-b rreload ~/.tmux.conf
C-b ?list all key bindings
tmux set -g <option> <value>set global session option
tmux set -s <option> <value>set server option
tmux set -w <option> <value>set window option
tmux set -p <option> <value>set pane option
tmux show-options -gview all global options
tmux show-environmentview variables passed to tmux
tmux set-environment <var> <val>set environment variable for new panes

🔗PLUGINS (TPM, RESURRECT, CONTINUUM)

BindingDescription
C-b Iinstall plugins listed in config
C-b Uupdate all installed plugins
C-b Alt-uuninstall plugins removed from config
C-b Ctrl-ssave session state manually (resurrect)
C-b Ctrl-rrestore session state manually (resurrect)

🔗SCRIPTING AND AUTOMATION

CommandDescription
tmux send-keys -t <target> "cmd" Entersend arbitrary keystrokes to pane
tmux capture-pane -p -t <target>print pane scrollback to stdout
tmux capture-pane -p -S -100print last 100 lines of pane
tmux pipe-pane -t <target> "cat > log"stream pane output to file
tmux display-message -p "#{session_name}"print formatted variable to stdout
tmux wait-for -S <channel>signal a wait channel
tmux wait-for <channel>block script until channel signalled
tmux if-shell "condition" "cmd"run tmux command conditionally
tmux set-hook -g after-new-window "cmd"execute command automatically on event

🔗TARGET SYNTAX REFERENCE

SyntaxTarget
-t sessionsession by name or index
-t session:windowspecific window in session
-t session:window.panespecific pane in window
-t :current session
-t :.current pane
-t :- / -t :+previous / next session
-t :^ / -t :$first / last window
-t !last (previously active) pane