Core LibraryunreleasedAPI Reference

Choose documentation 1

latest

Current version

latest
English

Unreleased libtmux_erlang has not been released. Its API may change during development. This site's structure and URLs may change too.

function libtmux-erlang latest

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:window(), layout()) -> {ok, tmux_operation:completed()} | {error, tmux_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/2 layout 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/2 or 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]}}
Parameters

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

Equivalents of Set a window's pane layout in other languages
Language Equivalent
Python libtmux.Window.select_layout
Ruby LibTmux::Window#select_layout
Lua libtmux.Window:layout
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript window.Window.selectLayout
Rust window.Window.select_layout
Go tmux.Window.SelectLayout
Java io.github.libtmux.Window.selectLayout
C# LibTmux.Window.SelectLayoutAsync
C++ libtmux::Window::select_layout
Swift Server.selectLayout(_:_:)
OCaml Libtmux_unix.Client.select_layout
Perl LibTmux::Server::select_layout 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#.

Esc

Type to search.

Reference previewOpen reference