From 30974a5403a070c7af56bcd9554ffc74e834ebcf Mon Sep 17 00:00:00 2001 From: REKHA SUTHAR <71004640+rekha0suthar@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:56:34 +0530 Subject: [PATCH] fix: handle Windows backslash path separator in grep search results On Windows, ripgrep outputs file paths with a backslash prefix (e.g. `.\path\to\file`) instead of the forward-slash prefix (`./path/to/file`) used on Unix systems. The existing check only matched `./`, causing the grep_search tool to return no results on Windows. Added `line.startsWith(".\\")` to the path-detection condition so that Windows-style paths are correctly identified as file headers. Fixes #13027 --- core/util/grepSearch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/util/grepSearch.ts b/core/util/grepSearch.ts index be5b7ee082f..73ac3f72262 100644 --- a/core/util/grepSearch.ts +++ b/core/util/grepSearch.ts @@ -57,7 +57,7 @@ export function formatGrepSearchResults( let resultLines: string[] = []; for (const line of results.split("\n").filter((l) => !!l)) { - if (line.startsWith("./") || line === "--") { + if (line.startsWith("./") || line.startsWith(".\\") || line === "--") { processResult(resultLines); // process previous result resultLines = [line]; numResults++;