Skip to content

Interface: TerminalModes

@termwright/driver


@termwright/driver / TerminalModes

Defined in: driver/src/api.ts:457

@termwright/driver — PTY + VT sessions, locators, actions and waits.

The normative public API lives in api.ts; this module is the only entry point and re-exports the types from there together with their runtime implementations.

import { launchTerminal } from '@termwright/driver';
const terminal = await launchTerminal({ command: ['node', 'app.js'] });
await terminal.waitForText('Ready');
await terminal.getByRole('button', { name: 'Approve' }).activate();
await terminal.close();

readonly applicationCursorKeys: boolean

Defined in: driver/src/api.ts:482


readonly applicationKeypad: boolean

Defined in: driver/src/api.ts:483


readonly bracketedPaste: boolean

Defined in: driver/src/api.ts:481


readonly focusReporting: "unknown" | "on" | "off"

Defined in: driver/src/api.ts:492

Whether the child asked for focus in/out reports, or 'unknown'.

'unknown' means the transport’s reading says nothing about the child. Certified PTY backends preserve focus DECSET; embeddings that cannot do so must declare the mode unobservable. Only an explicit production-state provider may supply the revision-bound fact; generic children/shadows may not. Observable VT must agree.


readonly mouseEncoding: "default" | "unknown" | "sgr" | "urxvt" | "utf8"

Defined in: driver/src/api.ts:480

Mouse report encoding, or 'unknown' when no authoritative source can prove it (see TerminalModes.mouseTracking). Pointer actions fail closed under 'unknown'; Termwright never guesses SGR.


readonly mouseTracking: "any" | "unknown" | "none" | "x10" | "vt200" | "drag"

Defined in: driver/src/api.ts:473

Mouse tracking level the child asked for, or 'unknown'.

'none' means observed off — the child enabled nothing. 'unknown' means neither the transport nor an explicit production-state provider can prove it. Certified PTY backends, including pinned passthrough ConPTY, preserve these mode requests; 'unknown' remains available for embeddings that do not. The distinction is load-bearing for pointer actions: 'none' is authoritatively off, while 'unknown' means Termwright cannot select a protocol without guessing. An explicitly registered production-state provider may supply same-revision evidence; a stdout shadow cannot, because descriptor/native/descendant writes bypass it. Both definite none and unresolved unknown fail before input is written, with distinct diagnostics.


readonly synchronizedOutput: boolean

Defined in: driver/src/api.ts:493