From 06c42093c84798f7740745ead50beb0d63d6e731 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Mon, 6 Oct 2025 23:24:00 -0500 Subject: [PATCH] tweak: grep tool to handle single file better (#3004) --- packages/opencode/src/tool/grep.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.ts index 3faeb6fb..cc654e33 100644 --- a/packages/opencode/src/tool/grep.ts +++ b/packages/opencode/src/tool/grep.ts @@ -20,12 +20,11 @@ export const GrepTool = Tool.define("grep", { const searchPath = params.path || Instance.directory const rgPath = await Ripgrep.filepath() - const args = ["-n", params.pattern] + const args = ["-nH", "--field-match-separator=|", params.pattern] if (params.include) { args.push("--glob", params.include) } args.push(searchPath) - args.push("--field-match-separator=|") const proc = Bun.spawn([rgPath, ...args], { stdout: "pipe",