# LibTmux.Program.await/2

- **Module:** LibTmux
- **Package:** libtmux
- **Language:** Elixir
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-elixir/blob/5bacf40788b43a5af27bb3656e727a921ba2db40/lib/libtmux/program.ex#L261
- **Page:** https://libtmux.org/en/elixir/pr-173/reference/libtmux-program-await-2/

```
await(program, timeout)
@spec await(t(), 1..600_000) ::
        {:ok, result()} | {:error, LibTmux.Error.t()}
```

Waits for application retirement and collects the final rendered screen.

A timed-out wait sends no cancellation. Repeated waits read the retained
exit evidence and reobserve the rendered screen. The screen is a separate
result because capture can fail after the application's exit is known.

## Parameters

- `program` (`t()`)
- `timeout` (`1..600_000`)
