fix(grep): handle Windows drive-letter paths and CRLF in parseOutput
The grep tool's content and count output modes always returned 'No
matches found' on Windows due to two issues:
1. Regex ^(.+?):(\d+):(.*)$ fails on Windows paths like
C:\path\file.ts:42:content because lazy .+? matches only 'C',
then \d+ fails on '\path\...'
2. ripgrep outputs CRLF line endings on Windows. After split('\n'),
trailing \r breaks the $ anchor in the regex, causing every
line to fail matching.
Fix: update parseOutput and parseCountOutput regexes to handle
drive-letter prefixes ([A-Za-z]:[\/]), and strip trailing \r
from each line before matching.
Note: PR #2976 attempted to fix (1) with --path-separator=/ but
this flag gets expanded by MSYS2/Git Bash to a full path, causing
a separate rg error. This PR avoids --path-separator entirely.
Closes #2962 R
rlavkvmflzk committed
b0b19f30b946fa75ea696663b1f85cb4dba61b13
Parent: 5de60d3
Committed by rlavkvmflzk <rlavkvmflzk@gmail.com>
on 4/10/2026, 8:37:53 PM