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.

method libtmux-rs latest

Pane.resize_by

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

Source and package
Qualified name
libtmux::pane::Pane::resize_by
Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
pub async fn resize_by( &mut self, direction: crate::ResizeDirection, cells: u32, ) -> Result<&mut Self, Error>

Description#

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

tmux command#

The tmux commands behind resize_by.

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference