3. Help
C-b ?
see all key bindings
tmux list-commands
list tmux sub commands
man tmux
tmux manual
4. Session Management
tmux new -s session_name
creates a new tmux session named session_name
tmux attach -t session_name
attaches to an existing tmux session named
session_name
tmux attach -t session_name -r
attaches in readonly mode
tmux switch -t session_name
switches to an existing session named session_name
tmux detach (C-b d)
detach the currently attached session
tmux list-sessions
lists existing tmux sessions
A session can have many windows. And the session can be shared by multiple clients, the screen is
synchronized among all clients.
5. Window Management
A window runs a command (shell by default)
C-b c
creates a new shell window
tmux new-window vi
creates a new window to run vi
C-b ,
change window name
C-b p
previous window
C-b n
next window
C-b &
kill window, or just C-d to exit shell, :q to exit vi
C-b #
# is digit from 0 to 9: choose window #
C-b w
choose window from menu
In menu:
C-p previous line
C-n next line
ESC cancel
Enter confirm selection
7. Pane Management
C-b “
Create new pane under current pane
C-b %
Create new pane on the right of current pane
tmux split-window -h vi
Split horizontal and run vi in it
C-b Left, C-b Right, C-b Up, C-b Down
Go to pane by direction
C-b C-Left, C-b C-Right, C-b C-Up, C-b C-Down
Resize the pane
C-b M-Left, C-b M-Right, C-b M-Up, C-b M-Down
Resize the pane in 5x steps
A window can be split into panes. By default new window has only one pane occupying all spaces.
8. Window/Pane History
C-p, C-n
move by line
C-f, C-b
move by char
Page Up, Page Down
previous window
C-s
search forward, ENTER to submit search
C-r
seasrch backward, ENTER to submit search
n
continue last search forward
p
continue last search backward
set-window-option -g mode-keys vi
use vi binding in copy mode
C-b [ start copy mode to scroll back, use following keybinding in copy mode
ESC exit copy mode