# LibTmux.FSharp.Pane.waitForText

- **Module:** LibTmux.FSharp
- **Package:** LibTmux.FSharp
- **Language:** F#
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.FSharp/Hierarchy.fsi#L237
- **Page:** https://libtmux.org/en/fsharp/latest/reference/libtmux-fsharp-pane-waitfortext/

```
val waitForText:
        cancellationToken: CancellationToken ->
        timeout: TimeSpan ->
        text: string ->
        pane: LibTmux.Pane ->
            Task<PaneWaitResult>
```

Waits for a line the pane prints to contain the text.

Text already on screen ends the wait at once as <c>PresentAtEntry</c>.
The wait sleeps on the pane's own output rather than polling, and ends
early when the pane's program exits or a full-screen program starts.
Running out of time returns the outcome <c>TimedOut</c>; only <c>Mirror.waitUntil</c> raises instead.

## Parameters

- `cancellationToken` (`CancellationToken`)
- `timeout` (`TimeSpan`)
- `text` (`string`)
- `pane` (`LibTmux.Pane`)

## Raises

- [`System.ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): The text is empty or spans lines.
- [`LibTmux.TmuxPaneException`](/en/csharp/latest/reference/libtmux-tmuxpaneexception/): The pane's program had already exited.
- [`LibTmux.TmuxObjectNotFoundException`](/en/csharp/latest/reference/libtmux-tmuxobjectnotfoundexception/): tmux no longer has the pane.
