tmux Sessions, Windows, and Panes

Core tmux commands and interactive shortcuts for managing sessions, windows, panes, splits, and layouts.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Session lifecycle
Start tmux
tmux

# Start a new unnamed session.

Create a named session
tmux new-session -s work

# Start a new session with an explicit name.

Create a named session and first window
tmux new-session -s work -n editor

# Name the session and initial window together.

Attach to the most recent session
tmux attach

# Reconnect to the last session.

Attach to a named session
tmux attach-session -t work

# Reconnect to a specific session.

Attach and detach other clients
tmux attach-session -d -t work

# Take over a session from other attached clients.

List sessions
tmux list-sessions

# Show existing sessions.

Kill a session
tmux kill-session -t work

# Terminate a session by name.

## Windows and panes
Create a new window
tmux new-window -n logs

# Open a fresh window in the current session.

Split pane left/right
tmux split-window -h

# Create a horizontal split.

Split pane top/bottom
tmux split-window -v

# Create a vertical split.

Tile all panes
tmux select-layout tiled

# Arrange panes in a tiled layout.

Resize pane to the left
tmux resize-pane -L 10

# Shrink or grow with an explicit size delta.

Swap panes
tmux swap-pane -s :.1 -t :.2

# Swap the current pane with another pane.

Break a pane into a new window
tmux break-pane

# Move one pane into its own window.

Broadcast input to all panes
tmux set-window-option synchronize-panes on

# Type into all panes at once.

## Default keyboard shortcuts
Detach client
Prefix d

# Leave the session running in the background.

Create a window
Prefix c

# Open a new window interactively.

Split top/bottom
Prefix "

# Interactive vertical split.

Split left/right
Prefix %

# Interactive horizontal split.

Preview windows and panes
Prefix w

# Open the chooser tree.

Enter copy mode
Prefix [

# Scroll, search, and copy from history.

Recommended next

No recommendations yet.