# LibTmux.Testing.TmuxTestFactory.CreateSessionAsync

- **Module:** LibTmux.Testing.TmuxTestFactory
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux.Testing/TmuxTestFactory.cs#L59
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-testing-tmuxtestfactory-createsessionasync/

```
LibTmux.Testing.TmuxTestFactory.CreateSessionAsync(options: TmuxTestOptions?, cancellationToken: CancellationToken) -> Task<TemporarySessionScope>
```

Starts a server and a session in it, both owned by this test.

The server this makes is left to the session's own scope, which is a
session on a server nobody else will kill.

## Parameters

- `options` (TmuxTestOptions?): How to reach tmux, or null for a socket of its own.
- `cancellationToken` (CancellationToken): Cancels the tmux commands.

## Returns

The scope owning the session.
