On this page
window.Window.format
- Module
- window
- Declared in
- Window
- Package
- libtmux
- Source
- crates/libtmux/src/window.rs
-
Expand a tmux format string in this window's context.
This returns
display-messageoutput instead of showing it in front of a person withSelf::display. Seecrate::Server::formatfor 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 expanded = window.format("#{window_id}").await?; assert_eq!(expanded.to_string_lossy(), window.id().to_string()); guard.shutdown().await?;
0 declared, 0 inherited