tmux.PaneObservation.WaitFor
Go
- Python Unavailable
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- Module
- tmux
- Declared in
- PaneObservation
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/pane_wait.go
- WaitFor ( ctx : context.Context , match : func(text string) bool ) (PaneText, error)
-
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.
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.
0 declared, 0 inherited