libtmux Reference MCP Search
On this page

window.Window.select_layout

View as Markdown

Module
window
Declared in
Window
Package
libtmux
Source
crates/libtmux/src/window.rs
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 .

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?;

0 declared, 0 inherited

Esc

Type to search.