Core LibraryalphaAPI 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.

function libtmux-cxx latest

layout_contains_pane

Whether pane_id (%N) is still part of a window's arrangement, reading a NotificationKind::layout_change notification's own text — window_layout followed by window_visible_layout and the window's flags (control-notify.c) — for its first, whitespace-delimited token.

Source and package
Qualified name
libtmux::layout_contains_pane
Namespace
libtmux
Package
libtmux-cxx
Source
include/libtmux/notification.hpp
[[C++ nodiscard attributeAsks the compiler to warn when a result is discarded. An explicit cast to void acknowledges that the result is intentionally ignored.Language documentation]] std::optional<bool> layout_contains_pane(std::string_view layout_change_text, std::string_view pane_id);

Description#

tmux gives no notification dedicated to a pane leaving its window; a %layout-change naming the pane gone is the only signal there is. This answers only from the JSON layout (3.8+, and only for a connection that requested it — see Window::layout()), which carries each pane's stable id. The classic layout string encodes each pane's position by index instead, which the removal of any other pane in the window renumbers, so this returns std::nullopt there rather than guessing: killing the observed pane is the one case a caller most wants an honest answer for, and a stale index is exactly where a guess would be wrong.

Esc

Type to search.

Reference previewOpen reference