tmux
Reference Guide

Terminal multiplexer -- sessions, windows, panes, and key bindings. Everything you need to manage persistent terminal sessions.

CLI Command Prefix Binding
Default prefix: Ctrl + b -- press the prefix first, then release and press the binding key. Commands marked CLI are typed directly in your shell. Commands marked PREFIX require the prefix key first.
01

Session Management

Essential

Sessions persist across terminal closes and SSH disconnects. Each session can have multiple windows.

Start new unnamed sessiontmux

Launches tmux with a default numbered session (0, 1, 2...).

Start named sessiontmux new -s name

Creates a session with a memorable name for easy reattachment.

List all sessionstmux ls

Shows all running sessions with their window count and dimensions.

Attach to sessiontmux attach -t name

Reconnects to an existing named session. Use tmux a for the most recent.

Kill a sessiontmux kill-session -t name

Destroys the named session and all its windows/panes.

Kill tmux servertmux kill-server

Terminates all sessions and the tmux server process entirely.

Rename current sessionPrefix $

Opens a prompt to rename the current session.

Detach from sessionPrefix d

Disconnects from the session but keeps it running in the background.

Switch sessions interactivelyPrefix s

Opens a tree view of all sessions and windows for interactive selection.

Previous / next sessionPrefix ( / )

Cycles through sessions in order.

Last used sessionPrefix L

Jumps to the most recently active session (capital L).

02

Window Management

Essential

Windows are like tabs within a session. Each window runs its own shell.

Create new windowPrefix c

Opens a new window with a fresh shell in the current session.

Rename current windowPrefix ,

Opens a prompt to give the current window a meaningful name.

Kill current windowPrefix &

Destroys the current window after a confirmation prompt.

Next / previous windowPrefix n / p

Cycles forward or backward through windows in the session.

Switch to window by numberPrefix 0-9

Jumps directly to a window by its index number.

List windows interactivelyPrefix w

Opens a tree view of all windows across all sessions.

Last active windowPrefix l

Toggles to the previously active window (lowercase L).

Find window by namePrefix f

Searches windows by name or content for quick navigation.

Move window to indexPrefix .

Reassigns the current window to a different index number.

03

Pane Management

Intermediate

Panes split a window into multiple terminals side by side or stacked.

Split vertically (side by side)Prefix %

Creates a new pane to the right of the current one.

Split horizontally (top/bottom)Prefix "

Creates a new pane below the current one.

Kill current panePrefix x

Closes the current pane after confirmation.

Toggle zoom (fullscreen)Prefix z

Maximizes the current pane to fill the window, or restores it.

Move focus by directionPrefix Arrow

Moves focus to the pane in the arrow key direction.

Cycle focus to next panePrefix o

Rotates focus through panes in order.

Last active panePrefix ;

Toggles focus to the previously active pane.

Show pane numbersPrefix q

Displays pane indices briefly. Press a number to jump to that pane.

Swap with previous / nextPrefix { / }

Swaps the current pane's position with its neighbor.

Break pane into windowPrefix !

Promotes the current pane to its own standalone window.

Resize pane (small steps)Prefix Ctrl+Arrow

Resizes the current pane by 1 cell in the arrow direction. Repeatable.

Resize pane (large steps)Prefix Alt+Arrow

Resizes the current pane by 5 cells in the arrow direction.

Cycle pane layoutsPrefix Space

Rotates through built-in layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, tiled.

04

Copy Mode (Scroll & Select)

Intermediate

Copy mode lets you scroll through terminal output, search, and copy text. Vi-mode bindings shown (default is emacs; set set -g mode-keys vi to switch).

Enter copy modePrefix [

Enters scrollback mode. Navigate with arrow keys or vi motions.

Exit copy modeq / Esc

Returns to normal mode from copy mode.

ScrollArrows / PgUp / PgDn

Navigate through the scrollback buffer in copy mode.

Jump to top / bottomg / G

Jumps to the start or end of the scrollback buffer (vi mode).

Start selectionSpace

Begins text selection at the cursor position (vi mode).

Copy selectionEnter

Copies the selected text to the tmux paste buffer and exits copy mode.

Search forward/ then text

Searches forward through the scrollback buffer.

Search backward? then text

Searches backward through the scrollback buffer.

Next / previous matchn / N

Jumps between search matches in the scrollback.

Paste bufferPrefix ]

Pastes the most recently copied text from the tmux buffer.

Choose paste bufferPrefix =

Opens a list of all paste buffers to select from.

05

Command Mode & Config

Intermediate

tmux has a built-in command prompt for runtime configuration and key binding management.

Open command promptPrefix :

Opens the tmux command line at the bottom of the screen.

Reload config:source ~/.tmux.conf

Re-reads the config file without restarting tmux or losing sessions.

Set global option:set -g option value

Changes a tmux option at runtime. Use -g for global scope.

Show all options:show-options -g

Displays every global option and its current value.

List key bindings:list-keys

Shows all current key bindings in a searchable list.

Bind a key:bind key command

Creates a new key binding at runtime.

Unbind a key:unbind key

Removes an existing key binding.

Show all bindingsPrefix ?

Displays a searchable list of every key binding.

Show clockPrefix t

Displays a clock overlay in the current pane.

Window infoPrefix i

Shows brief info about the current window in the status bar.

06

Misc & Configuration

Intermediate

Useful shortcuts, common config options, and power-user commands.

Quick attachtmux a

Shorthand to attach to the most recent session.

Server infotmux info

Shows tmux server information and terminal capabilities.

Reload config from shelltmux source ~/.tmux.conf

Reloads config from outside a tmux session.

Refresh clientPrefix r

Forces a redraw of the tmux client display.

Show message logPrefix ~

Displays the tmux internal message/debug log.

Enable mouseset -g mouse on

Add to ~/.tmux.conf for mouse scrolling, pane selection, and resizing.

Increase scrollbackset -g history-limit 50000

Sets the scrollback buffer to 50,000 lines (default is 2,000).

Windows start at 1set -g base-index 1

Numbers windows starting from 1 instead of 0 (easier to reach).

Add reload shortcutbind r source-file ~/.tmux.conf

Add to ~/.tmux.conf to reload config with Prefix r.

Note: This overrides the default Prefix r (refresh-client). Most users prefer the reload shortcut.
Check tmux versiontmux -V

Prints the installed tmux version number.

07

Common Workflows

Practical

Real-world usage patterns that combine multiple commands.

Start a named dev sessiontmux new -s work

Creates a persistent dev environment that survives terminal closes, SSH drops, and can be reattached from any terminal.

Side-by-side editor + terminalPrefix % then Prefix Arrow

Split vertically for a code editor on one side and a terminal on the other, then navigate between them.

Temporary fullscreen for a panePrefix z → work → Prefix z

Zoom in to read logs or debug output fullscreen, then zoom back out to restore your split layout.

Detach and reattachPrefix d → tmux a -t work

Detach from a long-running process, do other work, then reattach to pick up exactly where you left off.

Search scrollback outputPrefix [ → / → search → Enter

Enter copy mode to scroll through command output or search log files without a separate pager.

Multiple windows per sessionPrefix c then Prefix 0-9

Open separate windows for server, tests, git, etc. and jump between them by number.

Break out a busy panePrefix !

When a task in one pane grows too large for a split, promote it to its own full window.

Pull pane from another window:join-pane -s source

The reverse of break-pane: pulls a pane from another window into the current one as a split.