libtmux Reference MCP Search
On this page

window.Window.resize_by

View as Markdown

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

Resize the window to an exact size in cells.

Errors

Returns an error when tmux refuses the size. Move one edge of the window by a number of cells.

This is the form a keybinding uses: "make it two columns wider" rather than a size computed from the current one.

Errors

Returns an error when tmux refuses the resize.

Examples

use libtmux::ResizeDirection;

let session = server.new_session("resized-window").await?;
let mut window = session.windows().await?.remove(0);

window.resize(80, 24).await?;
window.resize_by(ResizeDirection::Down, 4).await?;
assert_eq!(window.height(), 28);

0 declared, 0 inherited

Esc

Type to search.