# LibTmux.PsmuxSession.GetWindowsAsync

- **Module:** LibTmux.PsmuxSession
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Psmux/PsmuxSession.cs#L46
- **Page:** https://libtmux.org/reference/dotnet/libtmux-psmuxsession-getwindowsasync/

```
LibTmux.PsmuxSession.GetWindowsAsync(cancellationToken: CancellationToken) -> Task<IReadOnlyList<PsmuxWindow>>
```

Reads the session's current windows.

## Parameters

- `cancellationToken` (CancellationToken) — Cancels the psmux query.

## Returns

Current immutable window observations.

## Raises

- `InvalidOperationException` — The selected namespace has no live session.
- `StaleServerGenerationException` — The sole session was replaced after this observation was read.
- `NotSupportedException` — The selected namespace contains more than one session.
- `LibTmuxException` — The verified client could not complete the query.
