# pane.Pane.is_at_top

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

```
pane.Pane.is_at_top(self) -> bool
```

Report whether the pane touches the top edge of its window.

The four edge predicates are what tell a caller a directional move has
nowhere to go: a pane at the top has no neighbour above it, so
selecting one would wrap or fail rather than move.

## Example

```rust
use libtmux::{SplitDirection, SplitOptions};

let guard = libtmux::test::TestServer::new().await?;
let session = guard.server().new_session("edges").await?;
let mut window = session.active_window().await?.expect("a window");

// One pane fills the window, so it touches every edge.
let only = window.active_pane().await?.expect("a pane");
assert!(only.is_at_top() && only.is_at_bottom());

// Splitting below leaves the original touching the top and not the
// bottom, and the new one the other way round.
let lower = window.split(SplitOptions::new(SplitDirection::Below)).await?;
let upper = window
    .panes()
    .await?
    .into_iter()
    .find(|pane| pane.id() != lower.id())
    .expect("the original pane");

assert!(upper.is_at_top() && !upper.is_at_bottom());
assert!(lower.is_at_bottom() && !lower.is_at_top());

guard.shutdown().await?;
```
