PaneObservation.WaitFor
WaitFor reads what the pane writes after the observation's baseline and calls match with all of it each time the pane writes, until match reports true, ctx ends, or the observation is lost. It returns the text match accepted, or what was read before the error. tmux pushes each write as it happens, so nothing is polled.
Source and package
- Qualified name
-
tmux.Pane Observation. Wait For - Package
- tmux
- Declared in
PaneObservation- Distribution
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/pane_wait.go
-
Description#
The baseline is not part of the text: check
PaneObservation.Baselinefor what was on screen already. A shell echoes what is typed into it, and the echo is output like any other, so open the observation before typing and match on what the command prints rather than on the command itself.Writes that arrived together reach match once. Exactly one read may run at a time, as for
PaneObservation.NextNotification, and a malformed notification is skipped asPaneObservation.Readerskips it.
Guides#
Pages that discuss WaitFor.