wait_regex
Wait for a regex pattern on a terminal screen, then snapshot; use to synchronize TUI readiness instead of blind delays after sending input.
Instructions
Block until pattern (a regex) appears on screen, then snapshot.
Returns {"ok", "matched", "alive", "exited", "text", "json"}. Timeout is
not an error: the call returns ok=true with matched=false plus the final
screen snapshot. exited is true only when the session was started with
detect_child_exit AND the child died before the pattern appeared, in
which case the wait returned at once instead of running to timeout_ms.
Screen lines are right-padded with spaces — end-anchored patterns never
match; use unanchored markers. This is the readiness sync — prefer it over
a blind delay after send_line/send_keys.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes | ||
| pattern | Yes | ||
| timeout_ms | No |