diff options
| author | Tommy D. Rossi <[email protected]> | 2025-10-12 06:24:48 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-10-11 23:24:48 -0500 |
| commit | b4171aa8e88c3bd09be970badb41cc750d82f61f (patch) | |
| tree | 7495cfef5849e9885461a6099ac80056578c9c0f /packages | |
| parent | d7a79733ea074661f371de0ec4a53480c08f0ed8 (diff) | |
| download | opencode-b4171aa8e88c3bd09be970badb41cc750d82f61f.tar.gz opencode-b4171aa8e88c3bd09be970badb41cc750d82f61f.zip | |
fix: `rg` hanging forever when run in bash, waiting for stdin (#3103)
Co-authored-by: Aiden Cline <[email protected]>
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/tool/bash.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index 0e1d37ecf..d4e8ce85a 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -1,6 +1,5 @@ import z from "zod/v4" -import { exec } from "child_process" - +import { spawn } from "child_process" import { Tool } from "./tool" import DESCRIPTION from "./bash.txt" import { Permission } from "../permission" @@ -146,9 +145,11 @@ export const BashTool = Tool.define("bash", { }) } - const process = exec(params.command, { + const process = spawn(params.command, { + shell: true, cwd: Instance.directory, signal: ctx.abort, + stdio: ["ignore", "pipe", "pipe"], timeout, }) |
