libtmux Reference MCP Search
On this page

pane.Pane.resize_by

View as Markdown

Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
resize_by ( mut , direction : crate::ResizeDirection , cells : u32 ) Result<&mut Self, Error>
method [source]
method [source]
resize_by

Move one edge of the pane by a number of cells.

This is the form a keybinding uses: "two rows taller" rather than a size computed from the current one. A pane that is alone in its window has no edge to move, and tmux accepts the request without doing anything.

Errors

Returns an error when tmux refuses the resize.

Examples

use libtmux::{ResizeDirection, SplitDirection, SplitOptions};

let session = server.new_session("resized-pane").await?;
let pane = session.panes().await?.remove(0);
pane.split(SplitOptions::new(SplitDirection::Below).command("sleep 300")).await?;

let mut pane = pane.refreshed().await?;
let before = pane.height();
pane.resize_by(ResizeDirection::Down, 2).await?;

assert_eq!(pane.height(), before + 2);

0 declared, 0 inherited

Esc

Type to search.