tmux
New session
tmux new[-session] [-n <session name>]
Attach session
tmux a[ttach[-session]] [<option>] [-t <session name>]
| Option | Description |
|---|---|
-d | Detach other clients |
Command
In CLI
tmux <command>
In tmux
Default prefix key: Ctrl + b
Execute command
- <prefix key>
Keyor:<command>
| Key | Command | Alias | Description |
|---|---|---|---|
:<command> | <command> | Command | |
| ? | list-keys | lsk | List keys binding |
| d | detach-client | detach | Detach |
| D | choose-client | Detach other clients | |
bind-key [-n] [-t <table>] <key> <command> [<arguments>] | bind | Bind key | |
unbind-key [-n] [-t <table>] <key> | unbind | Unbind key | |
| [ | copy-mode | Copy mode | |
| ] | paste-buffer | Paste buffer | |
| = | choose-buffer | Choose buffer |
Session
| Key | Command | Alias | Description |
|---|---|---|---|
list-sessions | ls | List session | |
| s | choose-tree | Tree mode for all session |
Window
| Key | Command | Alias | Description |
|---|---|---|---|
| c | new-window [-n<name>] <command> | neww | New window |
| % " | split-window [-h] <command> | splitw | Split window |
| 0 to 9 | select-window [-t <window>] | selectw | Select window |
| p | previous-window | prev | Previous window |
| n | next-window | next | Next window |
| l | last-window | last | Last window |
| w | choose-window | Tree mode for all window of attached session | |
| f | find-window | Find window or pane | |
| & | kill-window | killw | Kill current window |
Pane
| Key | Command | Alias | Description |
|---|---|---|---|
| Up Down Left Right | select-pane [-U] [-D] [-L] [-R] | selectp | Select pane |
| q | display-panes | displayp | Print pane numbers |
| x | kill-pane | killp | Kill active pane |
kill-server | Kill server | ||
kill-session | Kill session | ||
| z | resize-pane -Z | Zoom / UnZoom / Maximize |
Layout
| Key | Command | Alias | Description |
|---|---|---|---|
| Space | next-layout | Nex layout | |
| Alt + 1 to Alt + 5 | select-layout <layout> | Select layout |
Config
~/.tmux.conf
# Comment
<command>
Mouse
Ref: Getting-Started
Enable mouse
:set -g mouse on
Tree mode
| Key | Function |
|---|---|
Enter | Change the attached session, current window or active pane |
Up | Select previous item |
Down | Select next item |
Right | Expand item |
Left | Collapse item |
x | Kill selected item |
X | Kill tagged items |
< | Scroll preview left |
> | Scroll preview right |
Ctrl + s | Search by name |
n | Repeat last search |
t | Toggle if item is tagged |
T | Tag no items |
Ctrl + t | Tag all items |
: | Prompt for a command to run for the selected item or each tagged item |
O | Change sort field |
r | Reverse sort order |
v | Toggle preview |
q | Exit tree mode |
Copy mode
Default: emacs key
Use vi key
{VISUAL|EDITOR}={vi|vim|nvi}
| Command | vi Key | emacs Key |
|---|---|---|
begin-selection | Space | Ctrl + Space |
cancel | q | Escape |
copy-selection-and-cancel | Enter | Alt + w |
cursor-up | k | Up |
cursor-down | j | Down |
cursor-left | h | Left |
cursor-right | l | Right |
start-of-line | 0 | Ctrl + a |
back-to-indentation | ^ | Alt + m |
end-of-line | $ | Ctrl + e |
goto-line | : | g |
halfpage-down | Ctrl + d | Alt + Down |
halfpage-up | Ctrl + u | Alt + Up |
page-down | Ctrl + f | Page Down |
page-up | Ctrl + b | Page Up |
history-bottom | G | Alt + > |
history-top | g | Alt + < |
search-forward | / | Ctrl + s |
search-again | n | n |
search-reverse | N | N |
select-line | V |