# LibTmux.Session.KillAsync

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

```
LibTmux.Session.KillAsync(allExcept: bool, clearAlerts: bool, group: bool, cancellationToken: CancellationToken) -> Task
```

Stops this session.

Group stopping arrived in tmux 3.7. Older servers reject the flag and
stop nothing at all, so against those the request is logged and the flag
omitted: this session still dies, its group siblings do not.

## Parameters

- `allExcept` (bool) — Whether every other session is stopped instead of this one.
- `clearAlerts` (bool) — Whether alerts are cleared in every window instead.
- `group` (bool) — Whether every session in this session's group is stopped.
- `cancellationToken` (CancellationToken) — Cancels the tmux command.

## Raises

- `IncompleteSnapshotException` — <paramref name="group" /> is set on a handle resolved by identifier,
which carries no server to read a version from.
