# LibTmux.Testing.TmuxTestFactory.CreateWindowAsync

- **Module:** LibTmux.Testing
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux.Testing/TmuxTestFactory.cs#L120
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-testing-tmuxtestfactory-createwindowasync/

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

LibTmux.Testing.TmuxTestFactory.CreateWindowAsync(session: Session, options: TmuxTestOptions?, cancellationToken: CancellationToken) -> Task<TemporaryWindowScope>
```

Starts a server, a session, and a window, all owned by this test.

## Parameters

- `options` (`TmuxTestOptions?`): How to reach tmux, or null for a socket of its own. (for `CreateWindowAsync(options, cancellationToken)`)
- `cancellationToken` (`CancellationToken`): Cancels the tmux commands.
- `session` (`Session`): The session to start it in. (for `CreateWindowAsync(session, options, cancellationToken)`)
- `options` (`TmuxTestOptions?`): What to name it, or null for a name of its own. (for `CreateWindowAsync(session, options, cancellationToken)`)

## Returns

The scope owning the window.
