# Libtmux_eio.Client.wait_for_text

- **Module:** Libtmux_eio
- **Package:** libtmux-eio
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/eio/libtmux_eio.mli#L178
- **Public owner:** Libtmux_eio
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_eio-client-wait_for_text/

```
val wait_for_text :
  ?timeout:float ->
  ?scratch_dir:string ->
  t -> Libtmux.Pane.t -> text:string -> (Rendered.t, Libtmux.Error.t) result
```

Subscribe and capture the screen immediately, then recapture on output. Membership/overflow gaps establish fresh coverage in the same binding. Maximum pattern: 64 KiB. Return captured rendered text containing it; transient text may be missed. Deadlines are checked between bounded acquisitions, whose I/O retains the client exchange timeout. Cancellation propagates and releases the subscription. A cleanup failure cannot replace an earlier error or cancellation; inspect [`cleanup`](/en/ocaml/latest/reference/libtmux_eio-client-cleanup/) for secondary failures. Otherwise cleanup failure prevents success or renewed coverage. No history/barrier guarantee.

## Parameters

- `timeout?` (`float`)
- `scratch_dir?` (`string`)
- `arg1` (`t`)
- `arg2` (`Libtmux.Pane.t`)
- `text` (`string`)
