| name | tmux |
| description | Manages tmux sessions, windows, and panes, including detached SSH-surviving jobs and scripted send-keys layouts. Use when persisting remote work, multiplexing a server terminal, or automating multi-pane workspaces. Not for Windows Terminal / tmux-less PowerShell splits, GNU screen, or GUI IDE terminals. |
| version | 1.0.1 |
| category | development |
| risk | safe |
| source | community |
| date_added | 2026-03-28 |
| tags | ["tmux","terminal","multiplexer","sessions","shell","remote","automation"] |
| tools | ["claude","cursor","gemini"] |
tmux — Terminal Multiplexer
Overview
tmux keeps terminal sessions alive across SSH disconnects, splits work across multiple panes, and enables fully scriptable terminal automation. This skill covers session management, window/pane layout, keybinding patterns, and using tmux non-interactively from shell scripts — essential for remote servers, long-running jobs, and automated workflows.
The hierarchy has three levels: sessions (top level, survives disconnects), windows (tabs within a session), and panes (splits within a window). Everything is controllable from outside via tmux <command> or from inside via the prefix key (Ctrl-b by default).
Windows host note: tmux runs on the remote Linux/macOS server or inside WSL. On the Windows host you typically launch it from PowerShell via ssh user@host or wsl tmux .... All commands below are POSIX-shell commands executed on the target machine, not in PowerShell directly.
When to Use
- Setting up or managing persistent terminal sessions on remote servers
- Running long-running processes that must survive SSH disconnects
- Scripting multi-pane terminal layouts (logs + shell + editor)
- Automating
tmux commands from bash scripts without user interaction
- Pair programming via shared sessions on the same server
Prerequisites
tmux installed on the target machine (Linux, macOS, or WSL)
- SSH access to the remote host if managing remote sessions
- Optional:
~/.tmux.conf under version control for reproducible configs
Procedure
1. Session Management
tmux new-session -s work
tmux new-session -d -s work
tmux new-session -d -s build -x 220 -y 50 "make all"
tmux attach -t work
tmux attach
tmux list-sessions
tmux ls
tmux kill-session -t work
tmux kill-session -a
tmux rename-session -t old-name new-name
tmux switch-client -t other-session
tmux has-session -t work 2>/dev/null &&