# LibTmux.PsmuxPane.CaptureAsync

- **Module:** LibTmux.PsmuxPane
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Psmux/PsmuxPane.cs#L66
- **Page:** https://libtmux.org/en/dotnet/latest/reference/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.
