The default <prefix>
key is Ctrl-b
. To get more screen-like behavior, change the <prefix>
to Ctrl-a
in ~/.tmux-conf
like this:
unbind C-b
set -g prefix C-a
In Screen, to send Ctrl-a
to an application, you must hit Ctrl-a a
. Enable this for tmux using the following ~/.tmux-conf
entry:
bind-key a send-prefix
Vi style navigation between panes (splits)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
- start new session:
tmux
- start new named session:
tmux new -s myname
- attach to running session
tmux a
(orat
, orattach
) - attach to running named session:
tmux a -t myname
- list sessions:
tmux ls
- kill session:
tmux kill-session -t myname
- Kill all tmux sessions:
tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill
Note <prefix>
is Ctrl-b
by default unless configured otherwise, see above.
- Create new window:
<prefix> c
- Next window:
<prefix> n
- Previous window:
<prefix> p
- Name window:
<prefix> ,
- Split pane horizontally:
<prefix> "
- Split pane vertically:
<prefix> %
- Switch pane:
<prefix> <arrow-key>
(release Ctrl-b, then press an arrow key) - Resize pane:
<prefix>-<arrow-key>
(hold Ctrl-b while pressing the arrow key) - Toggle full screen for current pane (zoom):
<prefix> z
- Enter scroll mode:
<prefix> [
, then use arrow keys or page keys to scroll. Pressq
to quit scroll mode.
- Move current pane to new window:
<prefix> !
See https://www.devroom.io/2017/03/22/tmux-and-vim-copy-and-paste-on-macos-sierra/, but use new syntax as shown in alaska's comment here tmux/tmux#754