Windows, Panes and Sessions. Keyboard shortcuts, and how to configure custom key bindings
1# Debian
2sudo apt install -y tmux
3
4# macOS
5brew install tmux
tmux open tmuxexit or Ctrl+D to close a pane, exit tmuxtmux is controlled by a key combination of a prefix key, ‘C-b’ Ctrl-b by default, followed by a command key.
ctrl+b, then ? to open a list of all key bindingsctrl+b, then % to open a new pane (horizontal)ctrl+b, then " (double-quote) to open a pane (vertical)ctrl+b, then arrow key (left/right/up/down) to move between panes (horizontal)ctrl+b, then :kill-server to kill tmux entirely| Actions | Key bindings |
|---|---|
| Create a named session | tmux new -s SESSION_NAME |
| name/rename current session | <prefix> $ |
| detach from session | <prefix> d or tmux detach |
| list all tmux sessions | tmux ls |
| connect to the detached session | tmux a or tmux attach or tmux attach -d |
| Actions | Key bindings |
|---|---|
| create a new window | <prefix> c |
| close window | exit |
| kill all windows | <prefix> & |
| switch to next window | <prefix> n |
| switch to prev window | <prefix> p |
| switch to window using index | <prefix> 0-9 |
| Actions | Key bindings |
|---|---|
| kill current pane | <prefix> x |
| close pane | <prefix> D or exit |
| split horizontally | <prefix> " |
| split vertically | <prefix> % |
| move to pane | <prefix> arrow-key |
| zoom in/out on active pane | <prefix> z |