TerminalSession
Runtime terminal session that binds core, parser, input encoding, and a transport connector.
The connector owns transport threads. This session owns parser/core mutation serialization and all host-bound write ordering.
A session publishes one active render viewport. Two independently scrolling renderers must use separate sessions so their viewport requests do not race.
Constructors
Properties
Revision of the active shell command line, tracked only while collected.
Latest successfully published render generation, or -1 before the first frame is available.
the render publisher responsible for frame updates.
shared host-side prompt and command marker state.
Lifecycle state retained for current and future collectors.
public terminal buffer mutated by host output.
Functions
Returns the active shell command-line snapshot, when OSC 133 prompt markers provide a trustworthy visible range.
Returns the latest valid OSC 7 current-working-directory URI.
Encodes a focus event and writes it to the connector unless closed.
Encodes a mouse event and writes it to the connector unless closed.
Encodes a paste event and writes it to the connector unless closed.
Encodes a complete text replacement under one outbound lock acquisition.
Resolves a primitive render-frame hyperlink id to a target URI.
Reads a short-lived render frame while holding the terminal mutation lock.
Reads a render frame with a specified scrollback offset.
Reads a render frame with a specified scrollback offset and viewport rows limit.
Reads an absolute terminal row range while holding the mutation lock.
Requests a render-cache publication for a caller-owned scrollback viewport.
Requests a render-cache publication with optional render-only viewport overscan rows.
Resizes the terminal and captures its viewport anchor and history baseline under the same mutation lock before notifying the connector.
Updates the current and default cursor shape for the session.
Updates the active host security policy dynamically.
Updates the active terminal input policy dynamically.
Updates only the active paste sanitization policy.
Sets the theme-configured color palette for the session.
Applies the host's East Asian Ambiguous width policy for future writes.