Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

View as Markdown

Module
window
Declared in
Window
Package
libtmux
Source
crates/libtmux/src/window.rs
Other languages
PythonTypeScriptGoJava.NETC++Swift
select_layout ( mut , layout : impl Into<LayoutSpec> ) → Result<&mut Self, Error>
method [source]
method [source]
select_layout

Set the window's pane layout.

Takes a Layout tmux knows by name, or a layout string tmux itself produced through LayoutSpec::Saved . A &str, String, or OsString is read as a saved layout, so a caller who already had one keeps working.

Errors

Returns an error when tmux refuses the layout, and crate::ErrorKind::UnsupportedVersion when a named layout needs a newer tmux than this endpoint runs. See Layout::minimum_release .

In other ports Set a window's pane layout

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?;
await window.selectLayout("even-horizontal");

0 declared, 0 inherited

Esc

Type to search.