[!NOTE|label:references:]
files
FILES | DESCRIPTION |
---|---|
~/.tmux.conf |
|
$XDG_CONFIG_HOME/tmux/tmux.conf |
|
~/.config/tmux/tmux.conf |
Default tmux configuration file. |
/opt/homebrew/etc/tmux.conf |
System-wide configuration file. |
alias
COMMAND | ALIAS |
---|---|
attach-session |
attach , at , a |
detach-client |
detach |
has-session |
has |
list-clients |
lsc |
list-commands |
lscm |
list-sessions |
ls |
lock-client |
lockc |
lock-session |
locks |
new-session |
new |
refresh-client |
refresh |
rename-session |
rename |
show-messages |
showmsgs |
source-file |
source |
start-server |
start |
suspend-client |
suspend |
switch-client |
switchc |
sessions
linux commands
COMMAND | DESCRIPTION |
---|---|
tmux |
start a new session |
tmux new-session |
start a new session |
tmux new |
start a new session |
tmux new -s <name> |
start a new session with a name |
tmux new-session -A -s <name> |
start a new session or attach to an existing session named mysession |
tmux new -s <name> -n <window> |
start a new session with a name and a window |
tmux new-session -d -s <name> '<command>' |
start a new session with a name and a command |
tmux list-sessions |
list all sessions |
tmux ls |
list all sessions |
tmux kill-session -t <name> |
kill/delete a session |
tmux kill-ses -t <name> |
kill/delete a session |
tmux kill-session -a |
kill/delete all sessions but the current |
tmux kill-session -a -t <name> |
kill/delete all sessions but the |
tmux attach-session |
attach to the last session |
tmux attach |
attach to the last session |
tmux at |
attach to the last session |
tmux a |
attach to the last session |
tmux attach-session -t <name> |
attach to a session |
tmux attach -t <name> |
attach to a session |
tmux at -t <name> |
attach to a session |
tmux a -t <name> |
attach to a session |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:new |
start a new session |
:new -s <name> |
start a new session with a name |
:kill-session |
kill a session |
:attach -d |
detach others on the session (Maximize window by detach other clients) |
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b $ | rename the current session. |
ctrl + b d | detach from the current session. |
ctrl + b s | list all sessions. |
ctrl + b w | session and window preview |
ctrl + b ( | move to previous session |
ctrl + b ) | move to next session |
windows
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b c | create a new window |
ctrl + b , | rename the current window |
ctrl + b & | close the current window |
ctrl + b w | list windows |
ctrl + b p | preview window |
ctrl + b n | next window |
ctrl + b 0..9 | switch to window 0..9 |
ctrl + b l | toggle between last two windows |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:swap-window -s <src> -t <dst> |
swap window |
:swap-window -t -1 |
swap window with the previous one |
:move-window -s src_ses:win -t target_ses:win |
move window from src_ses to target_ses |
:movew -s foo:0 -t bar:9 |
move window 0 from session foo to 9 in session bar |
:movew -s 0:0 -t 1:9 |
move window 0 from session 0 to 9 in session 1 |
:move-window -s src_session:src_window |
reposition window in the current session |
:movew -s 0:9 |
reposition window 9 to the current session |
:move-window -r |
renumber windows to remove gap in the sequence |
:movew -r |
renumber windows to remove gap in the sequence |
panes
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b ; | toggle last active pane |
ctrl + b % | split pane vertically |
ctrl + b " | split pane horizontally |
ctrl + b { | move pane left |
ctrl + b } | move pane right |
ctrl + b ↑ | move pane up |
ctrl + b ← | move pane left |
ctrl + b → | move pane right |
ctrl + b ␣ | toggle between pane layouts |
ctrl + b o | move to the next pane |
ctrl + b q | show pane numbers |
ctrl + b q 0..9 | swith/select the pane number |
ctrl + b z | toggle pane zoom |
ctrl + b ! | convert pannel into a window |
ctrl + b + → | resize current pane width |
ctrl + b ctrl + → | resize current pane width |
ctrl + b + ← | resize current pane width |
ctrl + b ctrl + ← | resize current pane width |
ctrl + b + ↓ | resize current pane height |
ctrl + b ctrl + ↓ | resize current pane height |
ctrl + b + ↑ | resize current pane height |
ctrl + b ctrl + ↑ | resize current pane height |
ctrl + b x | close/kill the current pane |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:split-window -h |
== ctrl + b % split the current pane with a vertical line to create a horizontal layout |
:split-window -v |
== ctrl + b " split the current pane with a horizontal line to create a vertical layout |
:join-pane -s 2 -t 1 |
join two windows as panes (merge window 2 to window 1 as panes) |
:joinp -s 2.1 -t 1.0 |
move pane from one window to another (move pane 1 from window 2 to pane after 0 of window 1) |
:setw synchronize-panes |
toggle synchronize panes (send command to all panes) |
copy mode
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b [ | enter copy mode |
ctrl + b PgUp | enter copy mode and scroll up one page up |
q | quit copy mode |
g | go to the top of the buffer |
G | go to the bottom of the buffer |
↑ | scroll up one line |
↓ | scroll down one line |
k | move cursor up |
j | move cursor down |
h | move cursor left |
l | move cursor right |
w | move cursor forward one worda at a time |
b | move cursor backward one word at a time |
/ | search forward |
? | search backward |
n | next keyword occurrence |
N | previous keyword occurrence |
␣ | start selection |
esc | clear selection |
⏎ | copy selection to clipboard |
ctrl + b ] | paste selection |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:setw -g mode-keys vi |
set vi mode keys for copy mode |
:show-buffer |
show the buffer content |
:capture-pane |
copy entire visible contents of pane to a buffer |
:list-buffers |
list all buffers |
:choose-buffer |
choose a buffer to paste |
:save-buffer <file> |
save buffer to a file |
:delete-buffer -b 1 |
delete buffer 1 |
misc
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b : | enter command mode |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:set -g OPTION |
set OPTION for all sessions |
:setw -g OPTION |
set OPTION for all windows |
:set mouse on |
enable mouse mode |
help
linux commands
COMMAND | DESCRIPTION |
---|---|
$ tmux list-keys |
list key bindings ( shortcuts ) |
$ tmux info |
show every session, window, panes, etc ... |
tmux commands
COMMAND | DESCRIPTION |
---|---|
:list-keys |
list key bindings ( shortcuts ) |
shortcuts
SHORTCUTS | DESCRIPTION |
---|---|
ctrl + b ? | show help |