Function: launchTerminal()
@termwright/driver / launchTerminal
Function: launchTerminal()
Section titled “Function: launchTerminal()”launchTerminal(
options):Promise<TerminalHarness>
Defined in: driver/src/session.ts:257
Launches a program in a real PTY and returns a harness over it.
The semantic endpoint is created before the child starts, so an
instrumented application can hand over its first tree during startup. An
uninstrumented application simply never connects: after
semanticNegotiationMs adapter discovery closes and the session settles as
generic (semanticTree: false). A peer accepted before that boundary keeps
only its own bounded hello deadline before the same fail-closed outcome.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<TerminalHarness>
Example
Section titled “Example”const terminal = await launchTerminal({ command: ['node', 'app.js'] });await terminal.waitForText('ready');await terminal.press('Control+C');await terminal.close();