TerminalShellIntegrationState
Session-owned OSC 133 shell command timeline.
This model intentionally lives outside terminal core. Core owns bytes already committed to the terminal grid; shell integration markers are host metadata about prompt and command lifecycle. Records are anchored to stable core line identities, not absolute row numbers, so scrollback movement and resize reflow do not detach decorations from the content they describe.
Storage is data-oriented: each command field is a primitive column, records are append-only until bounded eviction, and paint paths consume only projected primitive arrays. All methods are thread-safe. Writers are normally invoked from the serialized session parser path; readers are UI threads that snapshot visible rows before painting.
Parameters
maximum retained command records before oldest-record eviction.
maximum retained UTF-16 command-text length per record; longer extracted text is stored as unknown.
wall-clock source used for command metadata timestamps.
Functions
Returns the preferred navigation anchor line for recordId.
Returns an immutable metadata snapshot for recordId.
Returns the retained command record that owns lineId.
Returns the retained command text for recordId.
Returns the OSC 7 working-directory URI snapshotted when recordId began.
Copies retained shell command records into caller-owned primitive arrays.
Copies projected shell decorations for a visible viewport.
Returns the latest accepted OSC 7 URI, or null before one is received.
Returns whether lineId belongs to a failed command range.
Returns whether lineId has a prompt-start marker.
Returns the newest retained command record id, skipping prompt-only records.
Returns the next retained command record after recordId.
Returns the nearest retained command record after lineId.
Observes the newest live viewport bottom row.
Returns the previous retained command record before recordId.
Returns the nearest retained command record before lineId.
Records command completion.
Records command execution start.
Returns the current number of retained shell command records.
Records the latest host-validated OSC 7 current-working-directory URI.
Records the end of the active shell prompt.
Records the start of a shell prompt.