# LibTmux.Window.FromEnvironmentAsync

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Window.FromEnvironment.cs#L17
- **Page:** https://libtmux.org/en/csharp/latest/reference/libtmux-window-fromenvironmentasync/

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

Returns the window holding the pane this process runs in.

Resolved through the pane rather than through the session id in
<c>TMUX</c>, which is frozen at pane spawn and goes stale when the
window is moved.

## Parameters

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

## Returns

The resolved window.
