Skip to content

feat(pager): add incremental search functionality#873

Open
glogiotatidis wants to merge 1 commit intocharmbracelet:masterfrom
glogiotatidis:feature/pager-search
Open

feat(pager): add incremental search functionality#873
glogiotatidis wants to merge 1 commit intocharmbracelet:masterfrom
glogiotatidis:feature/pager-search

Conversation

@glogiotatidis
Copy link
Copy Markdown

@glogiotatidis glogiotatidis commented Jan 16, 2026

Add search capability to the pager view:

  • Press / to enter search mode with incremental results
  • Smart case sensitivity (case-insensitive unless query has uppercase)
  • Navigate matches with n (next) and N (previous)
  • Highlighted matches with distinct current match styling
  • Press Esc to clear search and restore original content
  • Search persists across terminal resizes

Performance optimizations:

  • Use simple string matching instead of regex
  • Cache ANSI-stripped lines to avoid repeated processing
  • Reuse match positions for highlighting

This was vibe coded, but tested and reviewed by a human.

Fixes #834

@glogiotatidis glogiotatidis requested a review from a team as a code owner January 16, 2026 12:58
@glogiotatidis glogiotatidis requested review from aymanbagabas and raphamorim and removed request for a team January 16, 2026 12:58
Add less-style search to the pager with the following features:
- Press / to start searching, type query, Enter to confirm
- n/N to navigate between matches
- Smart case sensitivity (case-insensitive unless query has uppercase)
- Search highlighting with current match distinction
- Preserves ANSI formatting in highlighted lines

Fixes charmbracelet#834, charmbracelet#420, charmbracelet#323, charmbracelet#183
@astr0gator
Copy link
Copy Markdown

Hi guys, any updates on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TUI should support less-style searches

2 participants