You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the built-in rg tool compacts search results, it can truncate filenames with multiple numeric suffixes and display part of the filename where the line number should be. It can also group matches from two distinct files under one truncated filename. Standalone ripgrep returns the correct filenames and line numbers.
Affected version
1.0.114
Steps to reproduce the behavior
Run this in a shell. It creates two files with 32 matching lines each and prints their directory. The long directory path helps trigger compaction.
cd "$(mktemp -d /tmp/copilot-rg-compaction-repro-with-a-long-absolute-directory-path.XXXXXX)"
for file in sample.log.2-3-71-109 sample.log.2-3-73-112; do
awk 'BEGIN { for (i = 0; i < 32; i++) print "RG_REPRO" }' > "$file"
done
pwd
Start copilot in that directory and enter this prompt, replacing with the path printed above:
Use the built-in rg tool, not Bash, to search for RG_REPRO in . Use glob sample.log.*, content output, line numbers enabled, and a head_limit of 20. Show the tool output as-is.
The built-in tool reports 40 matches across 1 file. It groups both files under sample.log.2 and displays entries like 3- 71-109:1:RG_REPRO.
Expected behavior
The tool should report 40 matches across 2 files, preserving both full filenames and lines 1–20 for each. To compare, run rg -Hn -m 20 RG_REPRO sample.log.* in the same directory. Standalone ripgrep returns the same 40 matches with the correct filenames and line numbers.
Activity