libtmux_mcp.tools.pane_tools.search_panes
Python
- Python
- Ruby Unavailable
- Lua Unavailable
- TypeScript Unavailable
- Rust Unavailable
- Go Unavailable
- Java Unavailable
- .NET Unavailable
- C++ Unavailable
- Swift Unavailable
- libtmux_mcp.tools.pane_tools.search_panesSearchPanesResult
( 11 parameters )
-
Search visible terminal text across all tmux panes.
Use when the user asks what panes 'contain', 'mention', or 'show' — e.g. 'find the pane with the pytest failure'. Searches each pane's visible terminal scrollback content (not editor or browser text) and returns panes where the pattern is found, with matching lines.
Bounded output contract ----------------------- The result is paginated at the pane level. The matching panes are sorted by
pane_idand then sliced withoffset/limit. Each matching pane'smatched_linesis further tail-truncated to at mostmax_matched_lines_per_paneentries (most-recent lines preserved). Caps apply only to the slow path (pane.capture_pane(join_wrapped=True)+ Python regex); the tmux fast path at#{C:pattern}returns pane IDs only and is already bounded by tmux. The slow path joins wrapped visual rows so long lines can match across the pane's wrap column. The fast path remains tmux's native visual-row search, so useregex=Trueor an explicit content range to force the slow path when wrap-spanning text matters.- Parameters
-
-
pattern ( str ) – Text to search for in pane contents. Treated as literal text by default. Set
regex=Trueto interpret as a regular expression. -
regex ( bool ) – Whether to interpret pattern as a regular expression. Default False (literal text matching).
-
session_name ( str | None ) – Limit search to panes in this session.
-
session_id ( str | None ) – Limit search to panes in this session (by ID).
-
match_case ( bool ) – Whether to match case. Default False (case-insensitive).
-
content_start ( int | None ) – Start line for capture. Negative values reach into scrollback.
-
max_matched_lines_per_pane ( int ) – Per-pane cap on
matched_lines. Defaults toSEARCH_DEFAULT_MAX_LINES_PER_PANE. -
limit ( int | None ) – Maximum matching panes returned on this call. Defaults to
SEARCH_DEFAULT_LIMIT. PassNoneto disable the cap. -
offset ( int ) – Skip this many matching panes from the start. Use with
limitfor pagination.
-
- Returns
-
SearchPanesResult Paginated match list with
truncated/truncated_panes/total_panes_matched/offset/limitfields. - Raises
-
-
ExpectedToolError – If
patternis overSEARCH_MAX_PATTERN_LENGTH, does not compile, or if matching it against the captured lines exceedsSEARCH_MATCH_MAX_SECONDSin total. A pattern with nested quantifiers such as(a+)+can backtrack for hours on one ordinary line; anchor it or search for a literal.
-