## Tmux CLI
## New session
Start a new session
$ tmux
Start a new named session
$ tmux new -s myname
Show all sessions
$ tmux ls
## Kill session
Kill a session by name
$ tmux kill-ses -t myname
Kill sessions but the current
$ tmux kill-ses -a
Kill sessions but ‘myname’
$ tmux kill-ses -a -t myname
## Copy Mode
Command | Description |
---|---|
Ctrl+b [ |
Enter copy mode |
<Space> |
Start selection |
Enter |
Copy selection |
q |
Quit copy mode |
Ctrl+b ] |
Paste contents of buffer_0 |
For tmux version 3.5a on MacOS 15.3.1 Sequoia ‘Copy Mode’ functions lil bit differently Below I’ve written the differences
Command | Description |
---|---|
Ctrl + <Space> |
Start selection |
Ctrl + w |
Copy selection |
Mainly works like selecting text in Vim
## Tmux shortcuts
## Getting started
Shortcuts | Description |
---|---|
Ctrl+b ? |
List all shortcuts |
Show every session, window, pane, etc.
$ tmux info
## Panes (Splits)
Shortcuts | Description |
---|---|
Ctrl+b " / % |
Split Horiz/Vert |
Ctrl+b ! |
Pane -> Window |
Ctrl+b x |
Kill pane |
Ctrl+b <Arrow> |
Navigate panes |
Ctrl+b <Space> |
Toggle layouts |
Ctrl+b { / } |
Move to Left/Right |
Ctrl+b o |
Go to next panes |
Ctrl+b z |
Toggle full-screen |
Ctrl+b ; |
Toggle Last pane |
Ctrl+b q |
Show numbers |
Ctrl+b q 0 …9 |
Go to # pane |
## Tmux Command Mode
## Resizing
Command | Description |
---|---|
resize-pane -D 20 |
Resize down |
resize-pane -U 20 |
Resize up |
resize-pane -L 20 |
Resize left |
resize-pane -R 20 |
Resize right |
## Copying
Command | Description |
---|---|
list-buffers |
List all buffers |
show-buffer |
Show #0 contents |
capture-pane |
Copy of pane |
choose-buffer |
Show and paste |
save-buffer a.txt |
Save to file |
delete-buffer -b 1 |
Delete buffer 1 |