Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

feat: Add search_pane_contents() using tmux's native content search

Aperta
#645 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
50/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
api, cli

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

enhancement

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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tmux-python/libtmux

Tutte le issue di tmux-python/libtmux

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.