# LibTmux.Server.HasSessionAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Server.Lifecycle.cs#L101
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-server-hassessionasync/

tmux command: [`has-session`](/en/tmux/latest/manual/has-session/)

```
LibTmux.Server.HasSessionAsync(target: string, exact: bool, cancellationToken: CancellationToken) -> Task<bool>
```

Reports whether a session exists.

## Parameters

- `target` (`string`): The session to look for.
- `exact` (`bool`): Whether the name must match in full.
- `cancellationToken` (`CancellationToken`): Cancels the tmux command.

## Returns

True when tmux reports the session.
