Mac Terminal / SSH / Session Persistence
| Command | Description |
|---|---|
| tmux new -s <name> | Create new session with name |
| tmux new -s <name> -d | Create new session (detached) |
| tmux ls | List sessions |
| tmux a -t <name> | Attach to session |
| tmux attach -t <name> | Attach (same as above) |
| tmux a | Attach to last session |
| tmux kill-session -t <name> | Kill session by name |
| tmux kill-server | Kill all sessions (careful!) |
| tmux rename-session <new> | Rename current session |
| tmux switch -t <name> | Switch client to session |
| tmux list-sessions | Alias of tmux ls |
| Shortcut | Action |
|---|---|
| Ctrl-y d | Detach (session keeps running) |
| Command | Description |
|---|---|
| tmux attach -t <name> | Attach to named session |
| tmux a -t <name> | Attach (short form) |
| tmux a | Attach to last session |
| Shortcut | Action |
|---|---|
| Ctrl-y c | Create new window |
| Ctrl-y n | Next window |
| Ctrl-y p | Previous window |
| Ctrl-y 0–9 | Go to window by number |
| Ctrl-y , | Rename current window |
| Ctrl-y w | List windows (choose) |
| Ctrl-y & | Close current window |
| Shortcut | Action |
|---|---|
| Ctrl-y % | Split pane vertically |
| Ctrl-y " | Split pane horizontally |
| Ctrl-y o | Next pane |
| Ctrl-y ; | Previous pane |
| Ctrl-y { | Swap pane with previous |
| Ctrl-y x | Close current pane |
| Ctrl-y ! | Break pane to new window |
| Ctrl-y z | Toggle pane zoom (max/min) |
| Shortcut | Action |
|---|---|
| Ctrl-y ← ↑ ↓ → | Move between panes |
| Ctrl-y q | Show pane numbers |
| Ctrl-y t | Show clock |
| Ctrl-y Space | Cycle layouts |
| Ctrl-y ? | List all key bindings |
| Ctrl-y : | Command prompt |
| Ctrl-y ~ | Show previous messages |
| Shortcut | Action |
|---|---|
| Ctrl-y [ | Enter copy mode |
| Space / Enter | Start selection |
| ↑ ↓ ← → | Move cursor |
| PgUp / PgDn | Scroll up/down |
| Ctrl-y ] | Paste buffer |
| q / Esc | Exit copy mode |
| Shortcut | Action |
|---|---|
| Ctrl-y / | Search forward |
| Ctrl-y ? | Search backward |
| n | Next match |
| N | Previous match |
| Enter | Jump to match |
| q / Esc | Exit search |
| Shortcut / Command | Action |
|---|---|
| Ctrl-y : | Enter command prompt |
| resize-pane -L 10 | Shrink pane left by 10 |
| resize-pane -R 10 | Shrink pane right by 10 |
| resize-pane -U 5 | Shrink pane up by 5 |
| resize-pane -D 5 | Shrink pane down by 5 |
| Ctrl-y ← ↑ ↓ → | Resize pane (1 cell) |
| Ctrl-y Alt+← ↑ ↓ → | Resize pane (5 cells) |
| Command | Description |
|---|---|
| Ctrl-y : | Open command prompt |
| source-file ~/.tmux.conf | Reload config file |
| show-options -g | Show global options |
| show-options | Show current options |
| display-message "ok" | Test command execution |
| Command | Description |
|---|---|
| tmux list-panes | List panes in session |
| tmux list-windows | List windows |
| tmux list-clients | List attached clients |
| tmux info | Show tmux info |
| tmux show-buffer | Show paste buffer |
| tmux save-buffer -b <file> | Save buffer to file |
| tmux show-history | Show command history |
| tmux capture-pane -p | Print pane content |
| tmux pipe-pane -o 'cat >> out.log' | Pipe pane output to cmd |