# LibTmux.FSharp.Pane.sendAndWaitFor

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

```
val sendAndWaitFor:
        cancellationToken: CancellationToken ->
        keys: SendKeysRequest ->
        request: PaneWaitRequest ->
        pane: LibTmux.Pane ->
            Task<PaneWaitResult>
```

Sends keys as the request describes, then waits as the wait request describes.

As <c>sendAndWait</c>: only output after the keys counts, and literal
text is discounted from it. Key names are not.
Running out of time returns the outcome <c>TimedOut</c>; only <c>Mirror.waitUntil</c> raises instead.

## Parameters

- `cancellationToken` (`CancellationToken`)
- `keys` (`SendKeysRequest`)
- `request` (`PaneWaitRequest`)
- `pane` (`LibTmux.Pane`)

## Raises

- [`System.ArgumentException`](https://learn.microsoft.com/dotnet/api/system.argumentexception): The wait names no pattern.
- [`LibTmux.TmuxPaneException`](/en/csharp/latest/reference/libtmux-tmuxpaneexception/): The pane's program had already exited, or the pane changed during every read until the timeout, so nothing was sent.
- [`LibTmux.TmuxObjectNotFoundException`](/en/csharp/latest/reference/libtmux-tmuxobjectnotfoundexception/): tmux no longer has the pane.
