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.]] std::optional <bool> layout_contains_pane(std::string layout_view _change , std::_text string pane_view _id ); -
Description#
tmux gives no notification dedicated to a pane leaving its window; a
%layout-changenaming 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 — seeWindow::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 returnsstd::nulloptthere 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.- Parameters