# io.github.libtmux.Pane.Pane.await

- **Module:** io.github.libtmux.Pane.Pane
- **Package:** io.github.libtmux:libtmux
- **Language:** Java
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-java/blob/842228310449e879ebcaa3f910597757c9dbffd6/libtmux/src/main/java/io/github/libtmux/Pane.java#L484
- **Page:** https://libtmux.org/en/java/latest/reference/io-github-libtmux-pane-pane-await/

```
io.github.libtmux.Pane.Pane.await(settled: Predicate<Pane>, timeout: Duration) -> WakeReason
```

Waits until a condition holds for this pane as tmux reports it, and says why the wait ended.

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 {@link #awaitText} describes applies here too —
a signal on a {@link Server#channel} is exact, and this is for when nothing signals — and so do
its deadline rules.

## Parameters

- `settled` (Predicate<Pane>): receives this pane as it is now
- `timeout` (Duration): how long to keep looking

## Returns

why the wait ended

## Raises

- `ObjectDoesNotExistException`: if this pane is killed while its server stays up, which is not a timeout
- `InterruptedException`: if the waiting thread is interrupted

## Example

```java
pane.await(fresh -> !fresh.currentCommand().equals("zsh"), Duration.ofSeconds(5));
```
