KetraTerm
API · DevelopmentAll versions

HostPolicy

data class HostPolicy(val titlePolicy: TerminalTitlePolicy = TerminalTitlePolicy(), val hyperlinkPolicy: HostControlPolicy = HostControlPolicy.ALLOW, val currentWorkingDirectoryPolicy: HostControlPolicy = HostControlPolicy.ALLOW, val notificationPolicy: HostControlPolicy = HostControlPolicy.ALLOW, val windowManipulationPolicy: HostControlPolicy = HostControlPolicy.ALLOW, val palettePolicy: HostControlPolicy = HostControlPolicy.ALLOW, val terminalResponsePolicy: HostControlPolicy = HostControlPolicy.ALLOW, val clipboardPolicy: TerminalClipboardPolicy = TerminalClipboardPolicy(), val maxHyperlinkEntries: Int = 4096, val maxHyperlinkUriLength: Int = 4096, val maxHyperlinkIdLength: Int = 256, val maxNotificationTitleLength: Int = 256, val maxNotificationBodyLength: Int = 1024, val maxCurrentWorkingDirectoryUriLength: Int = 4096)

Host-facing security policy for terminal controls that can affect host state, retain host metadata, or write terminal-generated bytes back to the remote process.

The parser only recognizes protocols. This policy is evaluated in the host adapter before commands touch core state, host callbacks, metadata registries, or terminal-to-host response queues. Encoding validity is fixed by the OSC protocol contract before permission evaluation; permitting a command does not permit malformed structured data.

Constructors

Link copied to clipboard
constructor(titlePolicy: TerminalTitlePolicy = TerminalTitlePolicy(), hyperlinkPolicy: HostControlPolicy = HostControlPolicy.ALLOW, currentWorkingDirectoryPolicy: HostControlPolicy = HostControlPolicy.ALLOW, notificationPolicy: HostControlPolicy = HostControlPolicy.ALLOW, windowManipulationPolicy: HostControlPolicy = HostControlPolicy.ALLOW, palettePolicy: HostControlPolicy = HostControlPolicy.ALLOW, terminalResponsePolicy: HostControlPolicy = HostControlPolicy.ALLOW, clipboardPolicy: TerminalClipboardPolicy = TerminalClipboardPolicy(), maxHyperlinkEntries: Int = 4096, maxHyperlinkUriLength: Int = 4096, maxHyperlinkIdLength: Int = 256, maxNotificationTitleLength: Int = 256, maxNotificationBodyLength: Int = 1024, maxCurrentWorkingDirectoryUriLength: Int = 4096)

Properties

Link copied to clipboard

deny-by-default permission and audit policy for terminal-triggered clipboard protocols such as OSC 52.

Link copied to clipboard

whether OSC 7 current-working-directory reports may be retained and forwarded to the host.

Link copied to clipboard

whether OSC 8 hyperlinks may be retained and attached to written cells.

Link copied to clipboard

maximum accepted OSC 7 file URI length in UTF-16 code units. Longer or malformed URIs are ignored.

Link copied to clipboard

maximum distinct OSC 8 hyperlink keys retained after an accepted open. Lowering the limit defers least-recently-used eviction until the next accepted open, including explicit-key reuse; policy replacement itself does not mutate the registry or notify listeners.

Link copied to clipboard

maximum accepted OSC 8 id= parameter length in UTF-16 code units. Longer IDs are ignored and mapped to no active hyperlink.

Link copied to clipboard

maximum accepted OSC 8 URI length in UTF-16 code units. Longer URIs are ignored and mapped to no active hyperlink.

Link copied to clipboard

maximum retained UTF-16 code units for desktop notification bodies, without splitting a valid surrogate pair.

Link copied to clipboard

maximum retained UTF-16 code units for desktop notification titles, without splitting a valid surrogate pair.

Link copied to clipboard

whether terminal-triggered desktop notification requests may be forwarded to the host.

Link copied to clipboard

whether OSC palette updates, color-stack operations, and palette queries may affect core color state or enqueue terminal-to-host bytes.

Link copied to clipboard

whether DA, DSR/CPR (including light/dark scheme queries), DECRQM mode reports, window reports, DECRQCRA, DECRQSS, XTGETTCAP, OSC 21 colors, Kitty graphics, and OSC 52 reads may enqueue terminal-to-host response bytes. DENY also suppresses unsupported-mode, DECRQSS, and graphics failure replies. OSC 52 reads also require clipboard read permission; denying responses suppresses their empty failure replies too. Clipboard writes are unaffected. OSC 21 also requires palette permission; response denial suppresses unknown-key replies while permitted color mutations still apply.

Link copied to clipboard

session-wide policy for OSC title updates and title-stack restore operations before adapter/core title metadata changes or host callbacks are emitted.

Link copied to clipboard

whether terminal-triggered window movement, resize, minimize, raise, lower, and maximize requests may be forwarded. Logical DECCOLM column switches are independent of this policy.