tmux_window:select_layout/2
Select a built-in arrangement or restore a literal serialized layout for this registered physical window. Binary names must exactly match one of the five built-ins; abbreviations and other names are rejected. Legacy serialized layouts need four hexadecimal checksum digits, a comma and nonempty data. This guard avoids a malformed-header crash in tmux 3.3 and 3.3a.
Source and package
- Qualified name
-
tmux_window: select _layout/2 - Declared in
tmux_window- Package
- libtmux_erlang
- Source
- apps/libtmux_erlang/src/tmux_window.erl
- Other languages
- Perlmethod PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptRustGoJavaC#C++Swift Kotlin Scala OCaml F# Clojure
- select_layout(Window, Layout) -spec select_layout(tmux
_model: (), layout()) -> {ok, tmuxwindow _operation: ()} | {error, tmuxcompleted _operation: ()}.failure -
Description#
Native JSON v2 layouts require a bounded JSON object with V = 2 and an L object. They return unsupported_capability on tmux before 3.8 without dispatching a tmux command. This preserves
get/2layout restoration on newer servers.Execution unzooms the window and changes it in every linked session. tmux validates serialized geometry; malformed geometry can return a command error. The layout argument uses no shell or format expansion. Existing rows are not refreshed; use
get/2or a fresh snapshot to observe layout and pane geometry.Unsupported atom names fail before dispatch:
Examples#
1> tmux_window:select_layout(invalid_row, unknown_layout).{error,#{code => invalid_layout,path => [layout]}}
tmux command#
The tmux commands behind select_layout/2.
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 |
| 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 |
| C++ | libtmux:: |
| 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#.