Pane.is_at_top
Report whether the pane touches the top edge of its window.
Source and package
-
Description#
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.
Examples#
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?;
In other ports#
Whether a pane touches the top of its window
| Language | Equivalent |
|---|---|
| Python | libtmux |
| Haskell | No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing. |
| TypeScript | no equivalent on Pane |
| Go | tmux |
| Java | no equivalent on Pane |
| C# | Lib |
| C++ | libtmux:: |
| Swift | Pane |
| OCaml | No direct public OCaml equivalent is recorded for this operation. |
| Perl | No dedicated equivalent in the selected Perl surface. Explicit Server::cmd remains available for native tmux commands. |
No equivalent is recorded in Ruby, Lua, PowerShell, Julia, Erlang, Elixir, Common Lisp, Clojure, Kotlin, Scala or F#.