window.Window.search_panes
- Module
- window
- Declared in
- Window
- Package
- libtmux
- Source
- crates/libtmux/src/window/navigation.rs
- Other languages
- Python TypeScript Go Java .NET C++ Swift
-
The panes under this window that a matcher accepts, reporting why if the listing fails.
Errors
Returns an error when tmux cannot be reached or refuses the listing.
Discussed in Filtering and queries
In other ports Filter a window's panes with a tmux expression
- Python
libtmux.Window.search_panes - TypeScript no equivalent on
Window - Go
tmux.Window.SearchPanes - Java no equivalent on
Window - .NET
LibTmux.Window.SearchPanesAsync - C++ no equivalent on
Window - Swift no equivalent on
Window
- Python
Examples
use libtmux::query::Filterable as _;
let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("searched").await?;let window = session.active_window().await?.expect("a window");
let fields = libtmux::Pane::filter_fields();let found = window.search_panes(&fields.pane_active.eq(true)).await?;assert_eq!(found.len(), 1);
guard.shutdown().await?;>>> target_pane = window.split()>>> matches = window.search_panes(... filter=f'#{{m:{target_pane.pane_id},#{{pane_id}}}}'... )>>> [p.pane_id for p in matches] == [target_pane.pane_id]True0 declared, 0 inherited