# LibTmux.Pane.FromEnvironmentAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Pane.FromEnvironment.cs#L17
- **Page:** https://libtmux.org/en/csharp/latest/reference/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`](/en/csharp/latest/reference/libtmux-tmuxobjectnotfoundexception/): The environment does not name a pane, or tmux no longer has it.
