Core LibraryalphaAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-cxx latest

Window.select_layout

Rearrange the panes.

Source and package
Qualified name
libtmux::Window::select_layout
Namespace
libtmux
Declared in
Window
Package
libtmux-cxx
Source
include/libtmux/entities.hpp
Other languages
Perlmethod Erlang PowerShell Julia Elixir Haskell Common Lisp PythonRubyLuaTypeScriptRustGoJavaC#Swift Kotlin Scala OCaml F# Clojure
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] expected<void, CommandFailure> select_layout(std::string_view layout) const;

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

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
Erlang tmux_window:select_layout/2
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
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