# LibTmux.Session.HoldWaitClientAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Session.Scopes.cs#L32
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-session-holdwaitclientasync/

```
LibTmux.Session.HoldWaitClientAsync(cancellationToken: CancellationToken) -> Task<IAsyncDisposable>
```

Keeps the control client that waits on this session's panes use attached until the handle is disposed.

A wait on a pane attaches a control client to the pane's session and
reads through it, and lets it go when the wait ends unless another wait
still needs it. Attaching costs about as much as a tmux process start,
so holding the client saves that for each wait in a series, which then
costs little more than the keys it sends.

The client ignores its size, so it leaves window sizes alone, and is
excluded wherever this library tells observers from people attached.
tmux itself still lists it among the session's clients while it is
held, so the session counts as attached for <c>destroy-unattached</c>,
and the client keeps reading the session's output while no wait runs.
The hold is for this server process: one started again needs a new
one. When control mode is unavailable the waits poll, and the handle
holds nothing.

## Parameters

- `cancellationToken` (`CancellationToken`): Cancels attaching the client.

## Returns

A handle; disposing it lets the client detach once no wait needs it.
