Interface: ScreenSnapshot
@termwright/driver / ScreenSnapshot
Interface: ScreenSnapshot
Section titled “Interface: 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.
Example
Section titled “Example”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();Properties
Section titled “Properties”buffer
Section titled “buffer”
readonlybuffer:"normal"|"alternate"
Defined in: driver/src/api.ts:500
columns
Section titled “columns”
readonlycolumns:number
Defined in: driver/src/api.ts:498
cursor
Section titled “cursor”
readonlycursor:CursorInfo
Defined in: driver/src/api.ts:501
readonlymodes:TerminalModes
Defined in: driver/src/api.ts:502
revision
Section titled “revision”
readonlyrevision:number
Defined in: driver/src/api.ts:497
readonlyrows:number
Defined in: driver/src/api.ts:499
Methods
Section titled “Methods”ansi()
Section titled “ansi()”ansi():
string
Defined in: driver/src/api.ts:508
ANSI-styled serialization of the visible grid (addon-serialize).
Returns
Section titled “Returns”string
cell()
Section titled “cell()”cell(
row,column):CellSnapshot
Defined in: driver/src/api.ts:506
Parameters
Section titled “Parameters”number
column
Section titled “column”number
Returns
Section titled “Returns”html()
Section titled “html()”html():
string
Defined in: driver/src/api.ts:509
Returns
Section titled “Returns”string
line()
Section titled “line()”line(
row):string
Defined in: driver/src/api.ts:505
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”string
text()
Section titled “text()”text():
string
Defined in: driver/src/api.ts:504
Visible grid text, one string per row (trailing whitespace trimmed).
Returns
Section titled “Returns”string