Prerelease This site documents an alpha of libtmux. Its structure, URLs and APIs are subject to change.

pane.Pane.get

Rust
  • Python Unavailable
  • TypeScript Unavailable
  • Rust
  • Go Unavailable
  • Java Unavailable
  • .NET Unavailable
  • C++ Unavailable
  • Swift Unavailable

View as Markdown

Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
get ( self , field : F ) → Availability<F::Value<'_>>
method [source]
method [source]
get

Read one field of this pane's snapshot, named by the handle that filters it.

Every field a pane listing fetches reads this way, including those with no getter of their own. Nothing is sent to tmux, so the value is as old as the snapshot; Self::refresh renews it. The result says why a field holds no value: see Availability .

Examples

use libtmux::query::Filterable as _;
use libtmux::{Availability, Pane, TmuxText};
let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("read").await?;
let mut pane = session.panes().await?.remove(0);
let fields = Pane::filter_fields();
// Outside copy mode tmux reports no scroll position at all.
assert_eq!(pane.get(fields.scroll_position), Availability::Absent);
pane.copy_mode().await?;
pane.refresh().await?;
assert_eq!(pane.get(fields.scroll_position), Availability::Available(0));
assert_eq!(
pane.get(fields.pane_mode),
Availability::Available(&TmuxText::from("copy-mode")),
);
assert_eq!(pane.get(fields.pane_id), Availability::Available(pane.id()));
guard.shutdown().await?;

0 declared, 0 inherited

Esc

Type to search.