# LibTmux.PsmuxServer.GetPanesAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Psmux/PsmuxServer.cs#L135
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-psmuxserver-getpanesasync/

```
LibTmux.PsmuxServer.GetPanesAsync(cancellationToken: CancellationToken) -> Task<IReadOnlyList<PsmuxPane>>
```

Reads every pane in the sole session.

## Parameters

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

## Returns

Current immutable pane observations.

## Raises

- [`InvalidOperationException`](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception): The selected namespace has no live session.
- [`StaleServerGenerationException`](/en/csharp/latest/reference/libtmux-staleservergenerationexception/): The sole session was replaced after this server was connected.
- [`NotSupportedException`](https://learn.microsoft.com/dotnet/api/system.notsupportedexception): The selected namespace contains more than one session.
- [`LibTmuxException`](/en/csharp/latest/reference/libtmux-libtmuxexception/): The verified client could not complete the query.
