# LibTmux.SelectLayoutRequest.ToCommand

- **Module:** LibTmux
- **Package:** LibTmux
- **Language:** C#
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-dotnet/blob/cf34b255c896d19a97e7d7fabea58609c916012d/src/LibTmux/Requests/SelectLayoutRequest.cs#L50
- **Page:** https://libtmux.org/en/csharp/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`](https://learn.microsoft.com/dotnet/api/system.argumentnullexception): <paramref name="window" /> is null.
- [`TmuxWindowException`](/en/csharp/latest/reference/libtmux-tmuxwindowexception/): The layout is one tmux may not recognise.
