tmux
Use
tmux new -s work
tmux ls
tmux attach -t work
What It Does
tmux is a terminal multiplexer. It keeps terminal sessions alive after SSH disconnects and lets one SSH connection contain multiple windows or panes.
First Session
Create a named session:
tmux new -s workbench
Detach without killing the session:
Ctrl-b d
List sessions:
tmux ls
Attach again:
tmux attach -t workbench
Core Keys
Tmux uses a prefix key before most shortcuts. The default prefix is Ctrl-b.
| Action | Keys |
|---|---|
| Detach | Ctrl-b d |
| New window | Ctrl-b c |
| Next window | Ctrl-b n |
| Previous window | Ctrl-b p |
| Select window by number | Ctrl-b <window number> |
| Split horizontally | Ctrl-b " |
| Split vertically | Ctrl-b % |
| Move between panes | Ctrl-b then arrow key |
| Next pane layout | Ctrl-b Space |
| Zoom active pane | Ctrl-b z |
Recovery
tmux lssays no server: no tmux session exists, so create one.- Nested tmux warning: you are already inside tmux. Detach or open a new window.
- Command still died: tmux preserves terminals, not broken commands.
Docs Pointers
- Run
man tmux. - Read tmux wiki.
- Read terminal multiplexing, terminal, and SSH login.

Linux Foundations