Pane.is_piped
Report whether tmux is copying this pane's output to a command.
Source and package
- Qualified name
-
libtmux::pane:: Pane:: is _piped - Module
- pane
- Declared in
Pane- Package
- libtmux
- Source
- crates/libtmux/src/pane.rs
-
Description#
Self::pipe()toggles when given no command, so a caller who lost track of whether it is on cannot ask by calling it again -- that would turn it off, or start a second one. This says which state the pane is in.The value arrives with every pane listing already, so reading it costs nothing beyond the listing a caller has done anyway.
Examples#
let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("piped").await?;let mut pane = session.panes().await?.remove(0);assert!(!pane.is_piped());pane.pipe(Some("cat >/dev/null")).await?;pane.refresh().await?;assert!(pane.is_piped());pane.pipe(None::<String>).await?;pane.refresh().await?;assert!(!pane.is_piped());