# pane.Pane.get

- **Module:** pane.Pane
- **Package:** libtmux
- **Language:** Rust
- **Kind:** method
- **Source:** https://github.com/libtmux/libtmux-rs/blob/f0e37052c232636b61d095817046e6bfc8f2ca40/crates/libtmux/src/pane.rs#L1308
- **Page:** https://libtmux.org/en/rs/latest/reference/pane-pane-get/

```
pane.Pane.get(self, field: F) -> Availability<F::Value<'_>>
```

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`].

## Example

```rust
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?;
```
