Pane.await
Waits until a condition holds for this pane as tmux reports it, and says why the wait ended.
Source and package
- Qualified name
-
io.github .libtmux .Pane. await - Package
- io.github.libtmux
- Declared in
Pane- Distribution
- io.github.libtmux:libtmux
- Source
- libtmux/src/main/java/io/github/libtmux/Pane.java
- @Operation(Kind
.WAIT ) public WakeReason await( Predicate<Pane> settled, Duration timeout) throws InterruptedException @Operation(Kind.WAIT ) public WakeReason await( Predicate<Pane> settled, Duration timeout, Duration every) throws InterruptedException -
Description#
The pane is captured again before each test, so the condition reads fresh state rather than the capture this handle was built from. What the condition receives is an ordinary handle on this pane's server and can be kept. The ordering
#awaitText()describes applies here too — a signal on aServer#channel()is exact, and this is for when nothing signals — and so do its deadline rules.Examples#
pane.await(fresh -> !fresh.currentCommand().equals("zsh"), Duration.ofSeconds(5));- Parameters
-
-
settled(Predicate<Pane>) # – receives this pane as it is now forawait(settled, timeout) -
timeout(Duration) # – how long to keep looking forawait(settled, timeout) -
settled(Predicate<Pane>) # forawait(settled, timeout, every) -
every(Duration) # – how long to leave between looks, at least 10 ms forawait(settled, timeout, every)
-
- Returns
-
why the wait ended for
await(settled, timeout) - Raises
-
-
Target
Gone – if this pane is killed while its server stays up, which is not a timeout forException await(settled, timeout) -
Interrupted
Exception – if the waiting thread is interrupted forawait(settled, timeout) -
Illegal
Argument – ifException everyis shorter than 10 ms forawait(settled, timeout, every)
-