# LibTmux.Session.DetachClientAsync

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