# LibTmux.Session.DetachClientAsync

- **Module:** LibTmux.Session
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Session.Lifecycle.cs#L130
- **Page:** https://libtmux.org/en/dotnet/latest/reference/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.
