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

Window.resize_by

Resize the window to an exact size in cells.

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

Description#

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

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