specs/036-pane-wait-for-output-clear/spec.md
Specification: pane.wait_for_output and pane.clear
Created: 2026-10-10. Status: clarified.
herdr scripts can block until a pane prints a line and can clear a pane.
signaltty clients must poll pane.read for the first and cannot do the
second at all.
Acceptance
pane.wait_for_output {pane_id, match, regex?, mode?, lines?, after_seq?, strip_ansi?, timeout_s?}blocks until one line of the pane's text containsmatch(or matches it whenregexis true). It returns thepane.readresult of the read that matched plusmatched_line.modeandlineswork as inpane.read. Inrenderedmode only lines newer thanafter_seqcount, and the cursor advances between polls, so a line already on screen never satisfies a wait started after it.- No match before
timeout_s(default 3600) →TIMEOUT. An invalid regex →BAD_PARAMS. An unknown pane →NO_SUCH_PANE. A pane whose process has exited without a match →PANE_EXITED. pane.clear {pane_id}blanks the screen and scrollback in every view: the server's grid and history, and attached clients, which receive the clear in the normal output stream with consistent offsets.- Both are in
docs/08,method::ALL, the CLI (pane wait-output,pane clear) and integration tests.
Scope and clarification
Matching is per line, like herdr. herdr re-reads its whole window each poll,
so an old matching line satisfies a new wait; rendered mode with
after_seq avoids that, and screen/tail keep herdr's behavior. A clear
that lands while the program is mid-escape-sequence can cut that sequence;
terminals recover on the next byte. No unresolved requirements remain.