On this page
window.Window.select_layout
- Module
- window
- Declared in
- Window
- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
- select_layout ( mut , layout : impl Into<LayoutSpec> ) Result<&mut Self, Error>
-
Set the window's pane layout.
Takes a [
Layout] tmux 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.Errors
Returns an error when tmux refuses the layout, and
crate::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?;
0 declared, 0 inherited