Expand description
GET /agentmux/viewer/terminals/:block_id/feed: one terminal’s output,
live and read-only, for a paired device
(agentmux-mobile/docs/reports/REPORT_PANE_LIST_TERMINALS_AND_FROZEN_FEED_2026_10_12.md
§2.4, §2.5 phase B). Served beside the other viewer routes, on the viewer
listener only, for the viewer token only.
Off unless the user turns on “Share terminals with paired devices”
(viewer:shareterminals): a terminal’s scrollback routinely holds
secrets, and terminals have no per-pane hide flag. The shell drawer of an
agent hidden from paired devices is hidden with it. Nothing is ever sent
to the terminal: no input, no resize. The device renders at the size the
desktop gave the PTY (size events).
Wire (SSE): snapshot { offset, next_offset, data64, cols?, rows? }, the
last 256 KB of the terminal’s output from a line start; append { offset, data64 } per write; size { cols, rows } when the PTY is resized;
reset { reason } before a fresh snapshot, or before the stream ends
(behind, hidden, not_shared); : hb every 15 s. Ids are the byte
offset after the event; a reconnect whose Last-Event-ID is still within
256 KB of the end (a snapshot’s worth) gets the bytes it missed as one
append.
Structs§
- Term
Probe 🔒 - What a terminal feed asks while it runs: the PTY’s size, and whether it
may still be watched (
Some(reason)ends the stream). - Term
Snapshot 🔒 - A snapshot as read: its bytes start at
offset; the file ends atnext. - Term
Source 🔒 - Where a terminal feed reads the terminal’s output from: its
termfile. - Term
Timing 🔒 - A terminal feed’s clocks.
Enums§
- Unwatchable 🔒
- Why a block’s terminal can’t be watched.
Constants§
- SETTING_
SHARE_ 🔒TERMINALS - Settings key: let paired devices watch this computer’s terminals. Off unless set.
Functions§
- append_
event 🔒 - b64 🔒
- handle_
viewer_ 🔒terminal_ feed - refused 🔒
- reset_
event 🔒 - size_
event 🔒 - snapshot_
event 🔒 - terminal_
stream 🔒 - One terminal feed:
retry, asnapshot(or, for a reconnect that still holds, the bytes it missed as oneappend), then anappendper write,sizeon a resize,reset+snapshotwhen the file is truncated or the feed loses its place, and a heartbeat on a quiet stream. Ends withresetwhen the device falls more than 1 MB behind or the terminal may no longer be watched, and silently when the device is revoked or goes away. - terminal_
watchable 🔒 - Whether
block_idis a terminal a paired device may watch (sharing aside). - terminals_
shared 🔒 - Whether the user lets paired devices watch terminals.