libtmux Reference MCP Search
On this page

pane.Pane.format

View as Markdown

Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
format ( self , template : &str ) Result<TmuxText, Error>
method [source]
method [source]
format

Expand a tmux format string in this pane's context.

This returns display-message output instead of showing it in front of a person with Self::display. See crate::Server::format for the shell boundary around command and recursive formats.

Errors

Returns an error when tmux cannot be reached or refuses the format.

Examples

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("shown").await?;
let window = session.active_window().await?.expect("a window");
let pane = window.active_pane().await?.expect("a pane");

let expanded = pane.format("#{pane_id}").await?;
assert_eq!(expanded.to_string_lossy(), pane.id().to_string());

guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.