KetraTerm
API · v0.3.0All versions

HostEventSink

interface HostEventSink

Host-facing events emitted while parser commands are mapped to core state.

Hosts receive metadata and decide whether host-side actions can be honored. Grid mutation and terminal modes remain owned by core; session coordinates transport changes and terminal-to-host byte responses.

Callbacks are synchronous and ordered on the mutation caller's thread. A TerminalSession holds its mutation lock during delivery. Return promptly; do not mutate the session or wait for a UI thread. Schedule UI work using the product's lifecycle. Direct sinks propagate exceptions to the caller; the PTY convenience bridge isolates and reports listener failures. No initial state replay or per-frame delivery is performed.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun bell()

Called when the parser emits BEL.

Link copied to clipboard

Called after a valid OSC 7 current-working-directory URI is accepted.

Link copied to clipboard
open fun deminimizeWindow()

Called when the shell requests deminimizing (restoring) the window.

Link copied to clipboard
open fun hyperlinkRegistered(hyperlinkId: Int, uri: String, id: String?)

Called after a new OSC 8 registry entry is accepted. hyperlinkId is a positive session-local numeric identity; id is the optional application ID. Reusing an existing entry emits nothing. No browser action is implied.

Link copied to clipboard
open fun hyperlinkRemoved(hyperlinkId: Int)

Called after LRU eviction makes hyperlinkId unresolvable. Registration of its replacement follows this event. Numeric IDs are never reassigned. Closing OSC 8 or soft reset does not remove existing registry entries.

Link copied to clipboard

Called after hard reset clears a nonempty registry, instead of per-ID removals.

Link copied to clipboard
abstract fun iconTitleChanged(title: String)

Called after the OSC icon title metadata changes.

Link copied to clipboard
open fun lowerWindow()

Called when the shell requests lowering the window.

Link copied to clipboard
open fun minimizeWindow()

Called when the shell requests minimizing the window.

Link copied to clipboard
open fun moveWindow(x: Int, y: Int)

Called when the shell requests moving the window.

Link copied to clipboard

Called after the effective palette changes through OSC, host theme update, or hard reset. palette is the immutable core-owned value and may be retained. Queries, denied/invalid operations, and equal values do not emit an event.

Link copied to clipboard
open fun raiseWindow()

Called when the shell requests raising the window.

Link copied to clipboard
open fun requestColumnMode(rows: Int, columns: Int): Boolean

Accepts an application-requested 80/132-column switch before core changes.

Link copied to clipboard
abstract fun resizeWindow(rows: Int, columns: Int)

Called when the shell requests a window resize.

Link copied to clipboard
open fun setMaximized(maximize: Boolean)

Called when the shell requests maximizing or restoring the window.

Link copied to clipboard

Called when an OSC 133 shell integration marker is received.

Link copied to clipboard
open fun showNotification(title: String, body: String, level: NotificationLevel)

Called when the shell requests a desktop notification.

Link copied to clipboard

Called when an OSC 52 clipboard write request requires product-host user approval and has been decoded to text.

Link copied to clipboard

Called after an OSC 52 terminal clipboard request is evaluated by host policy.

Link copied to clipboard

Called when an OSC 52 clipboard write request has been allowed by host policy and decoded to text.

Link copied to clipboard
abstract fun windowTitleChanged(title: String)

Called after the OSC window title metadata changes.