tmux_stream_start
Start a persistent tmux control stream to capture pane output and window events for a session, with automatic reconnection on drop.
Instructions
Open (or reuse) a control-mode stream attached to session.
Starts a persistent tmux -C attach -t <session> connection that
captures pane output and window/layout events. Idempotent per
(target, session). Returns {"stream_id", "session", "target", "alive"};
pass the stream_id to tmux_stream_read/_send/_stop.
Pass width/height (both, tmux 2.4+) to set the control client's size
via refresh-client -C WxH right after attach — otherwise it defaults to
80x24 and wraps %output for wider panes oddly. The size is re-applied
automatically if the connection drops and reconnects; tmux_stream_resize
changes it later. The connection also auto-reconnects on an unexpected
drop (e.g. a flaky SSH link), surfacing reconnected/disconnected
events in the stream.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| session | Yes | ||
| target | No | ||
| width | No | ||
| height | No |