Core Library0.xAPI Reference

Choose documentation 3

latest

Current version

latest
English

Early release libtmux is released, and its APIs may still change between releases. This site's structure and URLs may change too.

method libtmux-rs latest

Pane.is_at_top

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

Source and package
Qualified name
libtmux::pane::Pane::is_at_top
Module
pane
Declared in
Pane
Package
libtmux
Source
crates/libtmux/src/pane.rs
Other languages
Perl Erlang PowerShell Julia Elixir Haskell Common Lisp Python Ruby Lua TypeScript Go Java C#C++Swift Kotlin Scala OCaml F# Clojure
#[must_use] pub fn is_at_top(&self) -> bool

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

Equivalents of Whether a pane touches the top of its window in other languages
Language Equivalent
Python libtmux.Pane.at_top
Haskell No public Haskell equivalent is implemented; the current modules expose scalar values and version parsing.
TypeScript no equivalent on Pane
Go tmux.Pane.AtTop
Java no equivalent on Pane
C# LibTmux.Pane.AtTop
C++ libtmux::Pane::at_top
Swift Pane.isAtTop
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#.

Esc

Type to search.

Reference previewOpen reference