Skip to content

Why test through a real terminal?

Use Termwright when a repeatable test needs to own a process, send terminal input, wait for rendered state, and retain failure evidence. A small tmux or expect script can be a better fit for one-off automation.

Needtmuxexpect / pexpectGrid-only test toolTermwright
Control an already running sessionYesNoNoNo
Launch a command in a PTYYesYesYesYes
Model a full VT screenPane capture/historyNoYesYes
Retry assertions against screen stateCustom scriptingPattern-basedVariesYes
Locate by role and nameNoNoNoWith an integration
Keep integrated failure artifactsCustom scriptingCustom scriptingVariesYes
  • the process already runs inside a human or remote session;
  • the session must survive disconnects and be inspected manually;
  • the goal is session control rather than a repeatable product test.

tmux can launch commands, send keys, and capture panes. A test suite must add its own isolation, assertions, readiness rules, cleanup, and failure artifacts.

The application is a line-oriented prompt and response program. Expect matches the byte stream well, but it does not model a full-screen application that repaints existing rows.

You need a real PTY, terminal cells, keyboard and mouse input, retries, process isolation, traces, or reports, but do not need framework semantics.

A test should locate widgets by role and accessible name, inspect component state, or assert qualified geometry. Integration capabilities differ by framework; see the compatibility matrix.