# LibTmux.Window.SelectLayoutAsync

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

tmux command: [`select-layout`](/en/tmux/latest/manual/select-layout/)

```
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`](/en/csharp/latest/reference/libtmux-tmuxwindowexception/): The layout is one tmux may not recognise.
