Pane.get
Read one field of this pane's snapshot, named by the handle that filters it.
Source and package
- Qualified name
-
libtmux::pane:: Pane:: get - Module
- pane
- Declared in
Pane- Package
- libtmux
- Source
- crates/libtmux/src/pane.rs
-
Description#
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: seeAvailability.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?;