machete

tmux cheatsheet

62 of 62 entries

List all key bindings

C-b?

Enter tmux command prompt

C-b:

Show clock in current pane

C-bt

Show pane numbers — press number to jump

C-bq

Switch to last session

C-bL

Switch to last window

C-bl

List sessions and switch

C-bs

Rename current session

C-b$

Detach from current session

C-bd

Previous session

C-b(

Next session

C-b)

Create new session

tmux new

Create new named session

tmux new -s <name>
tmux new -s mysession

List sessions

tmux ls

Attach to last session

tmux attach

Attach to named session

tmux attach -t <name>
tmux attach -t mysession

Kill named session

tmux kill-session -t <name>
tmux kill-session -t mysession

Rename session from CLI

tmux rename-session -t <old> <new>
tmux rename-session -t old new

Create new window

C-bc

Rename current window

C-b,

Next window

C-bn

Previous window

C-bp

Switch to window by number

C-b0..9

List windows, choose to switch

C-bw

Kill current window (confirm)

C-b&

Find window by name

C-bf

Move window — prompt for new index

C-b.

Move window (command form)

C-b:movew
move-window -t 2

Split pane vertically

C-b%

Split pane horizontally

C-b"

Go to next pane

C-bo

Toggle to last active pane

C-b;

Kill current pane (confirm)

C-bx

Zoom / unzoom active pane (fullscreen)

C-bz

Move to pane in direction

C-bArrows

Resize pane (repeatable, 1 cell)

C-bC-Arrows
resize-pane -U/-D/-L/-R

Resize pane by 5 cells

C-bM-Arrows

Swap pane with previous / next

C-b{C-b}

Cycle through pane layouts

C-bSpace

Arrange panes: even-h, even-v, main-h, main-v, tiled

C-bM-1..5

Rotate panes forward

C-bC-o

Break pane into a new window

C-b!

Join pane from another window

C-b:join-pane
join-pane -s 2.1

Toggle input sync to all panes in window

C-b:setwsynchronize-panes
setw synchronize-panes on

Enter copy mode (scroll / select)

C-b[

Paste buffer

C-b]

List paste buffers

C-b#

Choose buffer to paste

C-b=

Start selection (in copy mode)

Space

Copy selection and exit copy mode

Entery

Quit copy mode

q

Search down / search up in copy mode

/?

Next / previous search match

nN

Scroll in copy mode

PgUpPgDn

Kill tmux server — all sessions

tmux kill-server

Reload config

tmux source-file ~/.tmux.conf

Enable mouse support

tmux set -g mouse on

List all key bindings (CLI)

tmux list-keys

Show global options

tmux show -g

Kill pane from CLI

tmux kill-pane -t <id>
tmux kill-pane -t 1.0

New detached session running a command

tmux new -s <n> -d <cmd>
tmux new -s work -d htop

Show current session name

C-b:display-message-p'#S'