The default prefix binding is CTRL-B
tmux new -s my_session
tmux detach
(prefix + d)tmux list-sessions
tmux attach -t my_session
To kill a session, use prefix + :kill-session
.
tmux new-window
(prefix + c)tmux rename-window
(prefix + ,)tmux next-window
(prefix + n)tmux previous-window
(prefix + p)
- vertical split: prefix + %
- horizontal split: prefix + "
- swap panes: prefix + o
- kill pane: prefix + x
- toggle pane zoom: prefix + z
This assumes you are using vi style key bindings:
- To enable vi bindings, e.g. h/j/k/l navigation:
tmux set-window-option -g mode-keys vi
-
- Enter copy mode: prefix + [
-
- Hit Space to start a selection
-
- Navigate around and hit Enter to copy the selection
-
- Now paste what you put in the tmux buffer: prefix + ]
- save: prefix + ctrl-s
- restore: prefix + ctrl-r