fix(search): allow searching for a literal \c or \r

A query that starts with one of the two modifier prefixes could not be
escaped, so the text itself was unreachable: \c and \r were always consumed
as modifiers and the query ended up empty. A doubled backslash now ends the
modifier section and stands for the literal backslash, and the help line and
the docs document it.

Fixes #48
This commit is contained in:
BlackAngelTV committed 2026-12-03 10:01:34 +01:00
1 parent 1bd822b9e5
commit f616651c49
5 files changed
+37 -6

No files matched your search

+2 -1
View File
@@ -31,7 +31,8 @@ Search scrollback in place :sc:`search_scrollback_prompt`
The in-place search highlights every match without replacing the screen with a
pager. Prefix the query with ``\c`` to match case sensitively and with ``\r``
to use a regular expression; both modifiers can be combined. While the search
to use a regular expression; both modifiers can be combined. Write a doubled
backslash (``\\c``, ``\\r``) to search for those prefixes literally. While the search
is active, :kbd:`n` jumps to the next match, :kbd:`N` to the previous one and
:kbd:`Escape` ends it. The ``[current/total]`` counter is shown in the window
title and matches use the first marker color (see :opt:`mark1_foreground`).