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

PaneSize

How much space a new pane gets.

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

Examples#

use libtmux::{PaneSize, SplitDirection, SplitOptions};
// A size renders as tmux's own `-l` argument, cells bare and shares suffixed.
assert_eq!(PaneSize::Cells(20).to_string(), "20");
assert_eq!(PaneSize::Percent(25).to_string(), "25%");
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("work").await?;
let window = session.active_window().await?.expect("a session has a window");
let pane = window
.split(SplitOptions::new(SplitDirection::Below).size(PaneSize::Percent(25)))
.await?;
assert!(pane.height() > 0);
guard.shutdown().await?;

Variants2#

PaneSize variants
CasePayloadDescription
Cells (u32) A number of rows or columns, depending on the split direction.
Percent (u32) A share of the space being divided, as a percentage.
Esc

Type to search.

Reference previewOpen reference