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

Zoom the pane to fill its window, or restore it if it already fills it.

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

Description#

tmux models this as one toggle rather than two operations, and Window::is_zoomed() reports which way it went.

Errors

Returns an error when tmux refuses the request.

Examples#

use libtmux::{SplitDirection, SplitOptions};
let session = server.new_session("zoomed").await?;
let pane = session.panes().await?.remove(0);
pane.split(SplitOptions::new(SplitDirection::Below).command("sleep 300")).await?;
let mut pane = pane.refreshed().await?;
pane.toggle_zoom().await?;
assert!(pane.window().await?.expect("the window").is_zoomed());
pane.toggle_zoom().await?;
assert!(!pane.window().await?.expect("the window").is_zoomed());

tmux command#

The tmux commands behind toggle_zoom.

tmux C API#

The C declarations in tmux that implement these commands.

Esc

Type to search.

Reference previewOpen reference