# LibTmux.Pane.FromEnvironmentAsync

- **Module:** LibTmux.Pane
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/6656a563ec9e07ab52e0c3ac96f7704fc94cc0c0/src/LibTmux/Pane.FromEnvironment.cs#L17
- **Page:** https://libtmux.org/reference/dotnet/libtmux-pane-fromenvironmentasync/

```
LibTmux.Pane.FromEnvironmentAsync(environment: IReadOnlyDictionary<string, string>?, cancellationToken: CancellationToken) -> Task<Pane>
```

Returns the pane this process was spawned in.

## Parameters

- `environment` (IReadOnlyDictionary<string, string>?) — The environment, or null for the process.
- `cancellationToken` (CancellationToken) — Cancels the tmux commands.

## Returns

The resolved pane.

## Raises

- `TmuxObjectNotFoundException` — The environment does not name a pane, or tmux no longer has it.
