Terminal multiplexer CLI for persistent sessions, pane management, input injection, and output capture across local or remote shells.
$brew install tmux
AI Analysis
tmux is a terminal multiplexer that keeps shell sessions, windows, and panes alive behind a server you can detach from and reattach to later. Its CLI is most useful when work needs to survive SSH disconnects, run in parallel panes, or stay controllable after the original terminal closes.
What It Enables
- Start detached sessions and windows for servers, watch commands, REPLs, or deploy loops that need to keep running in the background.
- Split work across panes, send keystrokes or stdin to specific panes, and capture visible or historical pane output back to stdout or buffers.
- Coordinate long-running local or remote terminal workflows with session, window, and pane IDs, pipes, custom formats, and
wait-forsynchronization.
Agent Fit
- Commands such as
new-session -d,list-sessions -F,list-panes -F,send-keys,capture-pane -p, andpipe-panemake tmux usable as a non-interactive control layer around persistent shell processes. -Ccontrol mode adds a text protocol with%begin,%end,%output, and subscription notifications, but there is no JSON output mode for shell parsing.- Best when an agent needs durable terminal state or must revisit interactive program output later; less compelling when a task-specific CLI already exposes structured APIs directly.
Caveats
- Automation is only as reliable as the programs inside the panes; prompts, full-screen apps, and shell startup differences can make input driving brittle.
- In shared or multi-server setups, you need explicit socket, session, window, and pane targets to avoid acting on the wrong terminal state.