KetraTerm
API · DevelopmentAll versions

TerminalResponseChannel

Terminal-to-host response channel.

Host applications should drain these bytes and write them to the PTY/process input side. Parser/host code should use the request methods; core owns response contents that depend on core state such as cursor position.

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The number of queued response bytes currently waiting to be read.

Functions

Link copied to clipboard
abstract fun clearResponseBytes()

Discards all queued response bytes from this channel.

Link copied to clipboard
abstract fun queryDynamicColor(target: Int)

Enqueues the color query response for a dynamic target (10, 11, or 12).

Link copied to clipboard
abstract fun queryPaletteColor(index: Int)

Enqueues the color query response for a specific 256-color palette index.

Link copied to clipboard
abstract fun queryStatusString(query: String)

Enqueues the response for a DCS DECRQSS request.

Link copied to clipboard
abstract fun queryTerminfo(rawPayload: String)

Enqueues the response for a DCS XTGETTCAP request.

Link copied to clipboard
abstract fun readResponseBytes(dst: ByteArray, offset: Int = 0, length: Int = dst.size - offset): Int

Reads up to length queued response bytes into dst.

Link copied to clipboard
abstract fun requestDeviceAttributes(kind: Int, parameter: Int)

Enqueues a device attributes (DA) report response.

Link copied to clipboard
abstract fun requestDeviceStatusReport(mode: Int, decPrivate: Boolean)

Enqueues a device status report (DSR) response.

Link copied to clipboard
abstract fun requestKeyFormatOption(resource: Int)

Enqueues an allowlisted XTQFMTKEYS reply using the active format resource. Unknown and reserved resources stay silent; this protocol defines no failure reply. Host adapters must enforce terminal-response policy before calling this API.

Link copied to clipboard
abstract fun requestKeyModifierOption(resource: Int)

Enqueues an allowlisted xterm key-modifier option response.

Link copied to clipboard

Enqueues the active Kitty keyboard progressive-enhancement flags as a parameterless CSI ? u query response. Core reports only flags retained by its supported-mode mask.

Link copied to clipboard
abstract fun requestModeStatus(mode: Int, decPrivate: Boolean, hostCapabilities: Int = 0, defaultBackarrowSendsBackspace: Boolean = false)

Enqueues one ANSI or DEC private DECRPM reply (CSI [?] mode;status $ y). The explicit mode allowlist returns status 0 for unsupported queries. Negative identifiers produce no response. Queries do not mutate modes or invalidate rendering. Invoke under the same synchronization as core mutation. Host adapters must enforce terminal-response policy before calling this API.

Link copied to clipboard
abstract fun requestRectangleChecksum(requestId: Int, page: Int, top: Int, left: Int, bottom: Int, right: Int)

Enqueues a VT420 DECRQCRA response for an active-page rectangular area.

Link copied to clipboard
abstract fun requestWindowReport(mode: Int)

Enqueues an allowlisted window report response using current host geometry. Pixel-size query reports remain silent when the host has not supplied usable dimensions. Cell pixel dimensions use the integer text-area pixel size divided by the grid dimensions. Callers must enforce terminal-response permission for application queries.

Link copied to clipboard
abstract fun setChangeNotificationsAllowed(allowed: Boolean)

Publishes host permission for automatic color-scheme and resize reports.

Link copied to clipboard
abstract fun setWindowMinimized(minimized: Boolean)

Updates the recorded window minimization state.

Link copied to clipboard
abstract fun setWindowSizePixels(width: Int, height: Int)

Updates the recorded text-area size in pixels, excluding host padding. A changed size emits a subscribed mode 2048 report when permitted. Use the pixel-aware TerminalBuffer.resize overload when both grid and pixel dimensions change so one report describes the completed resize. If either dimension is nonpositive, both are recorded as unknown zero.