HostCommandAdapter
Production bridge from parser semantic commands to the terminal core.
The parser owns byte/protocol decoding. The core owns grid mutation, mode state, cursor physics, and width policy. This adapter is the narrow place where ANSI/DEC mode ids become concrete core API calls.
Serialize command calls and mutable metadata reads with the supplied terminal. Host callbacks run synchronously on that caller's thread and their failures propagate. Policy replacement and currentPolicy are safe across threads; metadata registries and the remaining command surface are not independently thread-safe.
Java callers may omit trailing optional constructor parameters, using the same defaults as Kotlin callers. Hosts with richer keyboard metadata or bell actions should supply their implemented capability masks explicitly.
Parameters
public core buffer API mutated by parser semantic commands.
optional sink for accepted host metadata and requests.
safety limits for host-owned metadata.
progressive Kitty keyboard flags the active input host can provide truthfully. The value must be a subset of the input encoder's implemented protocol mask.
implemented host actions from TerminalHostModeCapability.
current legacy Backspace default before DECBKM overrides it.
Constructors
Properties
The client-provided ID of the currently active hyperlink (OSC 8), or null if none.
The URI of the currently active hyperlink (OSC 8), or null if none.
Immutable active policy snapshot for asynchronous host-operation revalidation.
Core upload-invalidation token, read under the terminal's usual caller serialization.
Accepted OSC 22 pointer override, or null for host defaults. Safe to read from any thread. Pointer presentation is independent of window-manipulation and terminal-response permission.
The current authoritative core window title. Read under the same serialization as core mutation.
Functions
Commits a session-decoded image under the current response permission. Caller serialization must cover decoding admission through this commit.
Applies graphics controls under the current terminal-response policy. Denying replies does not suppress image admission or placement. Controls and payload are borrowed and consumed synchronously by the terminal.
Current decoded-byte budget for collecting larger OSC 52 writes. Denied writes return zero, retaining the parser's ordinary envelope bound and small-request auditing. This does not authorize execution: requestClipboard rechecks the current policy.
Returns the latest valid OSC 7 current-working-directory URI.
Returns the OSC 8 URI associated with hyperlinkId, or null.
Publishes the host default without requiring parser synchronization.
Updates the active host security policy dynamically.
Applies a host-selected theme and publishes an effective palette change. Unlike application OSC controls, this operation is not gated by host policy. The caller must serialize it with parser/core mutations.