On this page
pane.observe.Pane.wait_for_text
- Module
- pane.observe
- Declared in
- Pane
- Package
- libtmux
- Source
- crates/libtmux/src/pane/observe.rs
-
-
Wait until this pane's output contains
needle.Polls rather than streams, so it needs no feature: a caller who dispatches a command needs to know when it finished, and
Pane::send_keyswithout that is half an operation. A control-mode subscription would answer sooner and is not available in a default build.Each look reads the scrollback rather than the visible screen, and joins lines tmux wrapped. Both matter for correctness rather than completeness: text that scrolled off before the look would otherwise be missed and reported as absent, and a line wider than the pane arrives split, so a needle spanning the wrap point would never match.
A pane whose process ends answers
PaneWait::Deadrather than running to the deadline, because waiting longer cannot change it.Errors
Returns an error when tmux cannot be reached or refuses a capture. Running out of time is
PaneWait::TimedOut, not an error.Examples
use libtmux::PaneWait; use std::time::Duration; pane.send_line("printf 'ready\\n'").await?; let seen = pane.wait_for_text("ready", Duration::from_secs(10)).await?; assert_eq!(seen, PaneWait::Arrived);
0 declared, 0 inherited