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

Create, attach, list, rename, and destroy sessions.

Start tmux

Start a new unnamed session.

bashANYtmuxsessionstart
bash
tmux

Creates a new tmux server if needed and opens a client attached to a new session.

Create a named session

Start a new session with an explicit name.

bashANYtmuxsessionnew-session
bash
tmux new-session -s work

Use named sessions so you can reattach later without guessing targets.

Create a named session and first window

Name the session and initial window together.

bashANYtmuxsessionwindow
bash
tmux new-session -s work -n editor

Useful for repeatable project bootstrapping.

Attach to the most recent session

Reconnect to the last session.

bashANYtmuxattach
bash
tmux attach

Also available as `tmux a`.

Attach to a named session

Reconnect to a specific session.

bashANYtmuxattachtarget
bash
tmux attach-session -t work

Target by session name or id.

Attach and detach other clients

Take over a session from other attached clients.

bashANYtmuxattachdetach
bash
tmux attach-session -d -t work

Handy when reconnecting from a new machine.

List sessions

Show existing sessions.

bashANYtmuxsessionslist
bash
tmux list-sessions

Also available as `tmux ls`.

Kill a session

Terminate a session by name.

bashANYtmuxkill-session
bash
tmux kill-session -t work

Closes all windows and panes in the target session.

Windows and panes

Split, navigate, resize, move, and synchronize panes.

Create a new window

Open a fresh window in the current session.

bashANYtmuxwindownew-window
bash
tmux new-window -n logs

Creates a new shell in another window.

Split pane left/right

Create a horizontal split.

bashANYtmuxpanesplit-window
bash
tmux split-window -h

Creates a new pane beside the current one.

Split pane top/bottom

Create a vertical split.

bashANYtmuxpanesplit-window
bash
tmux split-window -v

Creates a new pane below the current one.

Tile all panes

Arrange panes in a tiled layout.

bashANYtmuxlayouttiled
bash
tmux select-layout tiled

Useful after many splits.

Resize pane to the left

Shrink or grow with an explicit size delta.

bashANYtmuxresize-pane
bash
tmux resize-pane -L 10

Use `-L`, `-R`, `-U`, or `-D` for direction.

Swap panes

Swap the current pane with another pane.

bashANYtmuxswap-pane
bash
tmux swap-pane -s :.1 -t :.2

Helpful when reordering pane positions.

Break a pane into a new window

Move one pane into its own window.

bashANYtmuxbreak-pane
bash
tmux break-pane

Useful when a pane deserves its own full window.

Broadcast input to all panes

Type into all panes at once.

bashANYtmuxsynchronize-panes
bash
tmux set-window-option synchronize-panes on

Great for running the same command across multiple hosts, but turn it off afterward.

Default keyboard shortcuts

Fast interactive actions using the default prefix.

Detach client

Leave the session running in the background.

textANYtmuxprefixdetach
text
Prefix d

With the default key table, the prefix is `Ctrl-b`.

Create a window

Open a new window interactively.

textANYtmuxshortcutwindow
text
Prefix c

Fastest way to open another shell.

Split top/bottom

Interactive vertical split.

textANYtmuxshortcutpane
text
Prefix "

Creates a pane below the current one.

Split left/right

Interactive horizontal split.

textANYtmuxshortcutpane
text
Prefix %

Creates a pane beside the current one.

Preview windows and panes

Open the chooser tree.

textANYtmuxshortcutchoose-tree
text
Prefix w

Useful for jumping across sessions, windows, and panes.

Enter copy mode

Scroll, search, and copy from history.

textANYtmuxshortcutcopy-mode
text
Prefix [

Often combined with vi-style keys in custom configs.

Recommended next

No recommendations yet.