Window.select_layout
Select layout for window.
Source and package
-
Description#
Wrapper for
$ tmux select-layout <layout>.- Parameters
-
-
layout(str | None) # – String of the layout, 'even-horizontal', 'tiled', etc. Entering None (leaving this blank) is same asselect-layoutwith no layout. In recent tmux versions, it picks the most recently set layout. 'even-horizontal' Panes are spread out evenly from left to right across the window. 'even-vertical' Panes are spread evenly from top to bottom. 'main-horizontal' A large (main) pane is shown at the top of the window and the remaining panes are spread from left to right in the leftover space at the bottom. 'main-vertical' Similar to main-horizontal but the large pane is placed on the left and the others spread from top to bottom along the right. 'tiled' Panes are spread out as evenly as possible over the window in both rows and columns. 'custom' Custom dimensions (see tmux(1) manpages). -
spread(bool | None) # – Spread panes out evenly (-Eflag). added 0.56 -
next_layout(bool | None) # – Move to the next layout (-nflag). added 0.56 -
previous_layout(bool | None) # – Move to the previous layout (-pflag). added 0.56
-
- Returns
-
WindowSelf, for method chaining. - Raises
-
-
libtmux
.exc – If tmux returns an error..Lib Tmux Exception -
Value
Error – If both layout and a flag (spread, next_layout, previous_layout) are specified.
-
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 |
|---|---|
| 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 |
| 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#.