session.Session.search_windows
- Module
- session
- Declared in
- Session
- Package
- libtmux
- Source
- crates/libtmux/src/session.rs
- Other languages
- Python TypeScript Go Java .NET C++ Swift
-
The windows under this session 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 session's windows with a tmux expression
- Python
libtmux.Session.search_windows - TypeScript no equivalent on
Session - Go
tmux.Session.SearchWindows - Java no equivalent on
Session - .NET
LibTmux.Session.SearchWindowsAsync - C++ no equivalent on
Session - Swift no equivalent on
Session
- Python
Examples
use libtmux::query::Filterable as _;
let guard = libtmux::test::TestServer::new().await?;let session = guard.server().new_session("searched").await?;session.new_window("build").await?;
let fields = libtmux::Window::filter_fields();let found = session.search_windows(&fields.window_name.eq("build")).await?;assert_eq!(found.len(), 1);
guard.shutdown().await?;>>> _ = session.new_window(window_name='gap7s_target')>>> _ = session.new_window(window_name='other_window')>>> matches = session.search_windows(filter='#{m:gap7s_*,#{window_name}}')>>> [w.window_name for w in matches]['gap7s_target']0 declared, 0 inherited