# LibTmux.Session.DetachClientAsync

- **Module:** LibTmux.Session
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Session.Lifecycle.cs#L141
- **Page:** https://libtmux.org/reference/dotnet/libtmux-session-detachclientasync/

```
LibTmux.Session.DetachClientAsync(shellCommand: string?, cancellationToken: CancellationToken) -> Task
```

Detaches every client attached to this session.

The session scope is always sent, because <c>-s</c> is the only
<c>detach-client</c> flag group that names a session rather than a
client.

## Parameters

- `shellCommand` (string?) — A command the detached clients run, when any.
- `cancellationToken` (CancellationToken) — Cancels the tmux command.
