# LibTmux.PsmuxPane.CaptureAsync

- **Module:** LibTmux.PsmuxPane
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Psmux/PsmuxPane.cs#L66
- **Page:** https://libtmux.org/reference/dotnet/libtmux-psmuxpane-captureasync/

```
LibTmux.PsmuxPane.CaptureAsync(options: PsmuxCaptureOptions?, cancellationToken: CancellationToken) -> Task<IReadOnlyList<string>>
```

Reads this pane's text through the audited capture subset.

Target consistency is best effort. An external process can remove the
pane between LibTmux's existence preflight and psmux's capture.

## Parameters

- `options` (PsmuxCaptureOptions?) — The typed capture range and rendering choices.
- `cancellationToken` (CancellationToken) — Cancels the psmux query.

## Returns

The captured lines.

## 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.
- `TmuxObjectNotFoundException` — The observed pane is no longer visible during the preflight.
- `LibTmuxException` — The verified client could not complete the query.
