Skip to content

Interface: ScreenSnapshot

@termwright/driver


@termwright/driver / ScreenSnapshot

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

@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 buffer: "normal" | "alternate"

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


readonly columns: number

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


readonly cursor: CursorInfo

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


readonly modes: TerminalModes

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


readonly revision: number

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


readonly rows: number

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

ansi(): string

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

ANSI-styled serialization of the visible grid (addon-serialize).

string


cell(row, column): CellSnapshot

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

number

number

CellSnapshot


html(): string

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

string


line(row): string

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

number

string


text(): string

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

Visible grid text, one string per row (trailing whitespace trimmed).

string