Repository navigation
fix(tui): recognise tagged grep hits - #427
Merged
Merged
Conversation
The grep tool writes `path:148 vp:text`, with a line tag between the number and the separator. The TUI's `parse_grep_hit` expected `:` or `-` right after the digits, so it matched none of those lines: grep results were painted as plain text, without the per-file headers, line gutter or match highlighting, and the header chip could not count files. The parser now skips an alphanumeric tag after the line number. Co-Authored-By: Claude Opus 5.5 <[email protected]>
mrnasil
force-pushed
the
fix/tui-tagged-grep-hits
branch
from
November 7, 2026 14:31
42e36a9 to
69500cc
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while reviewing tool output formats for the token-efficiency series (#418–#426). This is the grep counterpart of the read-line fix in #424.
Problem
The grep tool writes
path:148 vp:text, with a line tag between the number and the separator (the model's edit anchor). The TUI'sparse_grep_hitexpected:or-immediately after the digits, so it matched none of these lines. As a result:(N matches in M files)) could not count files.Change
parse_grep_hitnow skips an alphanumeric tag after the line number. Untaggedpath:12:text/path:12-textlines (ripgrep style,ast_grep) still parse as before.Checks
parse_grep_hit_match_and_contextnow also covers a tagged match, a tagged context line, and a bare space with no tag (rejected).grep_summary_counts_tagged_hits:(3 matches in 2 files).whycodes-tui --lib1495 passed; fmt and clippy are ok.🤖 Generated with Claude Code