# LibTmux.Session.GetWindowAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Session.Relations.cs#L59
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-session-getwindowasync/

```
LibTmux.Session.GetWindowAsync(id: WindowId, cancellationToken: CancellationToken) -> Task<Window>

LibTmux.Session.GetWindowAsync(target: string, cancellationToken: CancellationToken) -> Task<Window>
```

Reads one window in this session, throwing when it is absent.

## Parameters

- `id` (`WindowId`): The window identifier. (for `GetWindowAsync(id, cancellationToken)`)
- `cancellationToken` (`CancellationToken`): Cancels the tmux command.
- `target` (`string`): The window identifier or name. (for `GetWindowAsync(target, cancellationToken)`)

## Returns

The materialized window in this session.

## Raises

- [`TmuxObjectNotFoundException`](/en/csharp/latest/reference/libtmux-tmuxobjectnotfoundexception/): This session has no matching window.
- [`LibTmuxException`](/en/csharp/latest/reference/libtmux-libtmuxexception/): The lookup failed.
