libtmux Reference MCP Search
On this page

server.Server.format

View as Markdown

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

Expand a tmux format string and return the result.

This is display-message -p, whose target is a pane: the format is evaluated against it, so #{pane_current_command} and the session and window fields around it all resolve from there.

The result is [ TmuxText ] because a format can interpolate names that are not valid UTF-8.

A literal #(command) starts command in a shell. Recursive expansion, such as #{E:status-left}, can also expose a command stored in the expanded value. The job is asynchronous, so this call may return before it produces output. Escaping the outer template with ## does not escape text introduced by a recursive expansion. Use only validated, simple #{field} lookups with untrusted input.

Errors

Returns Error::ServerMismatch when the pane belongs to another server, or an error when tmux rejects the format or the pane is gone.

0 declared, 0 inherited

Esc

Type to search.