Window.select_layout
Set the window's pane layout.
Source and package
-
Description#
Takes a
Layouttmux knows by name, or a layout string tmux itself produced throughLayoutSpec::Saved. A&str,String, orOsStringis read as a saved layout, so a caller who already had one keeps working. Strings also accept unique named-layout abbreviations. Checksums and nonempty trees are checked before dispatch; tmux owns geometry correction and pruning. Nesting is limited to 256 groups.Errors
Returns
Error::InvalidLayoutfor unsafe syntax or an ambiguous name, an error when tmux refuses the layout, andcrate::ErrorKind::UnsupportedVersionwhen a named layout needs a newer tmux than this endpoint runs. SeeLayout::minimum_release().Examples#
use libtmux::Layout;let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("arranged").await?;let mut window = session.active_window().await?.expect("a window");window.select_layout(Layout::Tiled).await?;guard.shutdown().await?;- Parameters
-
-
layout(impl Into<LayoutSpec >) #
-
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 |
| 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#.