# LibTmux.SelectLayoutRequest.ToCommand

- **Module:** LibTmux.SelectLayoutRequest
- **Package:** LibTmux
- **Language:** .NET
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/320dc64f4b8b7815842471327a5e6b84a1499bf8/src/LibTmux/Requests/SelectLayoutRequest.cs#L50
- **Page:** https://libtmux.org/en/dotnet/latest/reference/libtmux-selectlayoutrequest-tocommand/

```
LibTmux.SelectLayoutRequest.ToCommand(window: Window) -> TmuxCommand
```

Returns a layout request as one tmux command for a window.

This takes the window because a layout name is checked against the ones
the running tmux knows, and an unrecognised name takes the whole server
down on tmux 3.3a. Batching a layout must not skip that check.

## Parameters

- `window` (Window): The window the layout applies to.

## Returns

The command, ready to add to a <see cref="TmuxChain" />.

## Raises

- `ArgumentNullException`: <paramref name="window" /> is null.
- `TmuxWindowException`: The layout is one tmux may not recognise.
