feat: Add search_pane_contents() using tmux's native content search
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 50/100
Direzione di ricerca
Start by inspecting the existing server.cmd('list-panes', ...) entry point and the libtmux-mcp search_panes consumer described in the issue. Confirm how matching pane IDs can be resolved to Pane objects, then verify that server- and session-scoped searches return only panes whose visible contents match the requested pattern and flags.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
libtmux has no high-level API for searching text visible in pane contents. Users must manually iterate panes and call capture_pane() on each — slow for many panes.
tmux native support
tmux's format system includes a C modifier that searches pane contents in C via window_pane_search() (in window.c). This reads directly from the internal grid data structure — no serialization or fork overhead.
The fastest programmatic approach is list-panes -f "#{C:pattern}", which:
- Runs content matching in C (not Python)
- Returns only matching panes
- Supports flags:
#{C/i:pattern}(case-insensitive),#{C/r:pattern}(POSIX regex),#{C/ri:pattern}(both)
This is the same mechanism behind find-window -C, but returns structured output instead of entering interactive window-tree mode.
Proposed API
# Server-wide search
server.search_pane_contents("error", case_sensitive=False)
# → list of Pane objects whose visible content matches
# Session-scoped search
session.search_pane_contents("error")
Implementation: call server.cmd('list-panes', '-a', '-f', '#{C/i:pattern}', '-F', '#{pane_id}'), then resolve matching pane IDs to Pane objects.
Context
The libtmux-mcp server has a search_panes MCP tool that would be a consumer of this API. Currently it calls server.cmd() directly — a proper API method would be cleaner.
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 127
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tmux-python/libtmux
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
tmux-python/libtmux#759 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
tmux-python/libtmux#745 · 2 commenti ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
tmux-python/libtmux#744 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tmux-python/libtmux#731 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
tmux-python/libtmux#654 ·
Tutte le issue di tmux-python/libtmux
Issue simili
-
New InternshipApertanew_internship
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
[BUG] Reports tab: "Unban" button tooltip shows raw `{{ip}}` placeholder instead of the IP addressApertabug javascript ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bunkerity/bunkerweb#4001 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
PedestrianDynamics/pyFDS-Evac#476 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
google/differential-privacy#516 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
adobe-fonts/source-serif#153 ·