# libtmux::Window::select_layout

- **Module:** libtmux::Window
- **Package:** libtmux-cxx
- **Language:** C++
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-cxx/blob/393d4b0ad666f18a6581f1eb281741a75a7503f0/include/libtmux/entities.hpp#L593
- **Page:** https://libtmux.org/en/cxx/latest/reference/libtmux-window-select_layout/

```
libtmux::Window::select_layout(layout: std::string_view) -> expected< void, CommandFailure >
```

Rearrange the panes.

tmux names five layouts, plus two mirrored ones on tmux 3.5+, and also accepts the layout description `layout()` returns.

Restoring one exactly — the same pane back at the same position, not only the same shape — holds on tmux 3.8+, where the saved string is JSON and carries each pane's id. On tmux 3.7 and earlier the classic layout string restores the shape but can rotate which pane lands in which cell (measured against raw tmux; not a choice this library makes). A JSON layout is refused before 3.8, and a mirrored preset before 3.5.

Anything not shaped like one of those — a leading `-`, a name tmux does not know, or an incomplete layout string — is refused before reaching tmux rather than passed through: on tmux 3.3 and 3.3a, that shape crashes the server outright rather than being refused.
