Expand description
The pure pieces of a paired device’s terminal feed
(GET /agentmux/viewer/terminals/:block_id/feed, the route in
server::http_viewer_terminal): where a snapshot of a terminal’s output starts,
and how each published append moves the feed’s byte cursor.
A terminal’s output is the block’s term file: the PTY’s raw bytes, ANSI
escapes and all, appended in order. Each append is published with the
byte offset it is written at, before it is written, so a feed that
subscribes, then reads the file’s size, can place every later event: an
event that ends at or before the cursor was in the snapshot, one that
starts past it means bytes were missed.
Enums§
- Term
Step - What to do with one published append.
Constants§
- LINE_
START_ 🔒WINDOW - How far into a tail a snapshot looks for a line start.
- SNAPSHOT_
TAIL_ BYTES - How much of a terminal’s output a snapshot holds, at most.
Functions§
- apply_
term_ append - Apply one published append, written at
offset, to a cursor atnext. - tail_
start - Where a snapshot of
data, read from byteoffsetof the file, starts: right after its first newline when it doesn’t start the file, so the device’s terminal doesn’t open in the middle of an escape sequence or a character; all of it when it starts the file, or has no newline early on.