# LibTmux.Session.GetActivePaneAsync

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

```
LibTmux.Session.GetActivePaneAsync(cancellationToken: CancellationToken) -> Task<Pane>
```

Reads from tmux the pane this session shows: its current window's active pane.

Asks tmux now, where <see cref="ActivePane" /> holds what a capture saw.

## Parameters

- `cancellationToken` (`CancellationToken`): Cancels the tmux command.

## Returns

The pane tmux reports.

## Raises

- [`TmuxObjectNotFoundException`](/en/csharp/latest/reference/libtmux-tmuxobjectnotfoundexception/): tmux reports no such pane.
