# Libtmux_unix.Client.wait_for_text

- **Module:** Libtmux_unix
- **Package:** libtmux-unix
- **Language:** OCaml
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-ocaml/blob/205dfda49742592b479247049d186956e4a4cfe9/unix/libtmux_unix.mli#L237
- **Public owner:** Libtmux_unix
- **Page:** https://libtmux.org/en/ocaml/latest/reference/libtmux_unix-client-wait_for_text/

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

Subscribe, capture the ordinary screen immediately, and recapture after output. Membership/overflow gaps trigger explicit fresh capture and new coverage in the same binding. Maximum pattern: 64 KiB. Success returns a capture that contains the text. Transient text between captures may be missed. Check the deadline between bounded acquisitions; in-flight I/O retains the client's exchange timeout. Release the temporary subscription without replacing an earlier error or cancellation; inspect [`cleanup`](/en/ocaml/latest/reference/libtmux_unix-client-cleanup/) for secondary failures. Otherwise cleanup failure prevents success or renewed coverage. No capture/stream barrier exists.

## Parameters

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