# LibTmux.Window.SelectLayoutAsync

- **Module:** LibTmux.Window
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Window.Layout.cs#L119
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-window-selectlayoutasync/

```
LibTmux.Window.SelectLayoutAsync(request: SelectLayoutRequest?, cancellationToken: CancellationToken) -> Task<Window>
```

Applies a layout to this window.

Feeding a previously captured <see cref="Layout" /> back restores the
same pane sizes on every version, but on tmux 3.7 and earlier it can
rotate which pane lands in which position - measured by hand, not a
hypothetical. tmux 3.8 and newer accepts the JSON form of the layout
(from a plain, non-control client) and restores the exact arrangement,
including which pane id sits where; the classic checksum-prefixed form
never carries pane ids and so cannot.

## Parameters

- `request` (SelectLayoutRequest?): The layout to apply.
- `cancellationToken` (CancellationToken): Cancels the tmux command.

## Returns

A replacement handle carrying the new layout.

## Raises

- `TmuxWindowException`: The layout is one tmux may not recognise.
