Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

enum libtmux-rs latest

Layout

One of the pane arrangements tmux knows by name.

Source and package
Qualified name
libtmux::window::Layout
Module
window
Package
libtmux
Source
crates/libtmux/src/window.rs
enum window.Layout

Description#

tmux has exactly these, so a layout that does not exist is a compile error rather than a refusal at the far end of a round trip. A saved layout string is a different thing and goes through LayoutSpec::Saved.

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::EvenHorizontal).await?;
assert_eq!(Layout::EvenHorizontal.as_str(), "even-horizontal");
guard.shutdown().await?;

Variants7#

Layout variants
CasePayloadDescription
EvenHorizontal No payload Panes side by side, each the full height.
EvenVertical No payload Panes stacked, each the full width.
MainHorizontal No payload One large pane above a row of the rest.
MainHorizontalMirrored No payload The arrangement of Layout::MainHorizontal with the large pane below the row rather than above it.
MainVertical No payload One large pane beside a column of the rest.
MainVerticalMirrored No payload The arrangement of Layout::MainVertical with the large pane on the right rather than the left.
Tiled No payload Panes in as even a grid as their count allows.

Members2#

  • as_str method The name tmux knows this layout by.
  • minimum_release method The first tmux release that arranges panes this way.
Esc

Type to search.

Reference previewOpen reference