Window.select_layout
Rearrange the panes.
Source and package
- [[
C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.]] expected<void, CommandFailure > select_layout(std::string layout) const;_view -
Description#
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, the first release that sends one, 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.- Parameters
tmux command#
The tmux commands behind select_layout.
tmux C API#
The C declarations in tmux that implement these commands.
In other ports#
Set a window's pane layout
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Ruby | Lib |
| Lua | libtmux |
| Erlang | tmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | window |
| Rust | window |
| Go | tmux |
| Java | io |
| C# | Lib |
| Swift | Server |
| OCaml | Libtmux |
| Perl | Lib Explicit Server operation. Captured entities remain local observations; use a new snapshot to observe changes. |
No equivalent is recorded in PowerShell, Julia, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.