tmux cheat sheet
(C-x means ctrl+x, M-x means alt+x)
Clients, sessions, windows, panes
Session is a set of windows, plus a notion of which window is current.
Window is a single screen covered with panes. (Once might compare it to a ‘virtual desktop’ or a ‘space’.)
Pane is a rectangular part of a window that runs a specific command, e.g. a shell.
Client is attached to a session.
Lost between sessions, windows and panes?
Get information where you are at the moment
C-b i print current client/session/window/pane
Creating a session:
tmux new-session -s work
Create a new session that shares all windows with an existing session, but has its own separate notion of which window is current:
tmux new-session -s work2 -t work
Attach to a session:
tmux attach -t work
Detach from a session:
Switch between sessions:
C-a ( previous session C-a ) next session C-a L ‘last’ (previously used) session C-a s choose a session from a list
C-a $ rename the current session C-a
Create a window:
C-a c create a new window
Switch between windows:
C-a 1 ... switch to window 1, ..., 9, 0 C-a 9 C-a 0 C-a p previous window C-a n next window C-a l ‘last’ (previously used) window C-a w choose window from a list
Switch between windows with a twist:
C-a M-n next window with a bell, activity or content alert C-a M-p previous such window
Forget about the mouse.
Copy mode has two purposes
Copy text anywhere in the scrollbuffer
Navigate terminal output history in the scrollbuffer
C-b [ Go into copy mode
C-b [ Go into copy mode Select text and press enter to copy C-b ] And paste