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
-
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.