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.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
#[must_use] pub fn is_piped(&self) -> bool

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());
Esc

Type to search.

Reference previewOpen reference