Tmux: Session, Window, Pane

Session

Start a session

tmux
tmux new
tmux new -s something

Detach a session

CTRL-b d – Detach from current session

tmux detach

List sessions

tmux ls

CTRL-b s – Show sessions from inside the session

Attach to a session

tmux attach
tmux a
tmux a -t 0
tmux a -t something

Rename a session

tmux rename -t 0 db-ses

CTRL-b $ – Rename current session from inside the session

Window

CTRL-b c – Create a new window

CTRL-b , – Rename current window

CTRL-b w – List windows (and sessions, and panes)

CTRL-b p – Previous window

CTRL-b n – Next window

CTRL-b [0-9] – Jump to window 0-9

CTRL-b & – Close a window (or type exit or CTRL-d)

Pane

CTRL-b % – Split vertical

CTRL-b " – Split horizontal

CTRL-b E – Spread pane equally

CTRL-b spacebar – Cycle pane layout

CTRL-b :select-layout even-horizontal | even-vertical | main-horizontal | main-vertical | tiled

CTRL-b [up, down, left, right] – Move between panes

CTRL-b [ – Scroll window

CTRL-b z – Expand/shrik pane (zoom)

CTRL-b ! – Convert pane to window

CTRL-b q – Show pane number

CTRL-b q [0-9] – Switch to pane 0-9

CTRL-b { – Move pane to left

CTRL-b } – Move pane to right

CTRL-b x – Close a pane (or type exit or CTRL-d)

Join two panes from different window

  1. CTRL-b + m – Mark a pane (or a window)
  2. Go to target pane (or window)
  3. CTRL-b + : join-pane

or

  1. CTRL-b + w – Show all windows
  2. Select source pane and press m
  3. Go to target pane and type : join-pane

or

CTRL-b + : join-pane -s 2.0 -t 1.1 – Join from window 2 pane 0 to window 1 pane 1

CTRL-b + : join-pane -t 1.1 – Join from current pane to window 1 pane 1

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *