fix(search): allow searching for a literal \c or \r #52
Merged
BlackAngelTV
merged 2 commits from 2026-12-03 10:01:54 +01:00
fix/search-literal-escapes into main
No Reviewers
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: FWS/FWS-Kitty#52
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
The in-place search query parser treated a leading
\cand\ras modifiers with no way to escape them, so those strings themselves could not be searched: the query became empty and the prompt failed with "the search query is empty".A doubled backslash now ends the modifier section and stands for the literal backslash, so
\\cand\\rsearch for the text. Modifiers still combine with an escaped prefix (\c\\ris a case sensitive search for\r).Changes
kitty/scrollback_search.py: escape handling inparse_query().kitty/window.py: the search prompt and the action help document the escaping.docs/basic.rst,docs/changelog.rst: same for the documentation.kitty_tests/scrollback_search.py: parsing and matching tests for the escaped prefixes.Tests
python3 -m unittest kitty_tests.scrollback_searchruff checkandruff format --checkon the touched Python filesFixes #48