feat(search): highlight and navigate scrollback matches in place

Searching the scrollback used to replace the whole screen with an external pager, losing the surrounding context. Highlight every match with a marker instead, show the [current/total] counter and provide temporary n/N/Escape bindings, restoring the previous marker and title when the search ends.
This commit is contained in:
BlackAngelTV committed 2026-11-13 08:22:07 +01:00
1 parent dc13716431
commit 7b306f5bed
5 files changed
+342

No files matched your search

+15
View File
@@ -4140,6 +4140,21 @@ For more sophisticated control, such as using the current selection, use :ac:`re
map('Search the scrollback within a pager', 'search_scrollback --allow-fallback=shifted,ascii cmd+f search_scrollback', only='macos')
map(
'Search and highlight the scrollback in place',
'search_scrollback_prompt kitty_mod+shift+f search_scrollback_prompt',
long_text="""
Search the scrollback without opening a pager. Every match is highlighted in
the scrollback and the ``[current/total]`` counter is shown in the window title.
Prefix the query with ``\\c`` to match case sensitively and with ``\\r`` to use
a regular expression. While a search is active, :kbd:`n` and :kbd:`N` jump to
the next and previous match and :kbd:`Escape` ends the search.
The :ac:`scrollback_search_next`, :ac:`scrollback_search_prev` and
:ac:`clear_scrollback_search` actions can be mapped to other keys.
""",
)
egr() # }}}