page 2: everything else that makes tmux worth it on a remote box.
one window for the editor, one for logs, one for the shell — one SSH session.
| Ctrl-b c | create new window |
| Ctrl-b n / p | next / previous window |
| Ctrl-b 0..9 | jump to window by number |
| Ctrl-b , | rename current window |
| Ctrl-b w | list windows, pick with arrows |
tail a log while editing a config, without a second terminal.
| Ctrl-b % | split vertically (left / right) |
| Ctrl-b " | split horizontally (top / bottom) |
| Ctrl-b arrows | move between panes |
| Ctrl-b z | zoom pane fullscreen (again to unzoom) |
| Ctrl-b x | kill current pane |
tmux new -s train python train_model.py # runs for hours Ctrl-b d # detach, log off, sleep # next morning: tmux attach -t train # check on it
remote terminals often can't scroll. tmux can:
| Ctrl-b [ | enter scroll (copy) mode |
| arrows / PgUp | scroll around |
| q | quit scroll mode |
two people SSH into the same server and attach to the same session — both see and type in the same terminal:
# person A: tmux new -s pair # person B: tmux attach -t pair
tmux new -s clientA tmux new -s clientB tmux ls # see them all tmux attach -t clientA # jump between contexts Ctrl-b s # switch sessions from inside tmux
| tmux kill-session -t name | kill one session |
| tmux kill-server | kill everything (nuclear) |
| Ctrl-b ? | list all keybindings |