Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/cross-spawn-spawner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const make = Effect.gen(function* () {
Sink.isSink(x) ? "pipe" : x

const stdin = (opts: ChildProcess.CommandOptions): ChildProcess.StdinConfig => {
const cfg: ChildProcess.StdinConfig = { stream: "pipe", encoding: "utf-8", endOnDone: true }
const cfg: ChildProcess.StdinConfig = { stream: "ignore", encoding: "utf-8", endOnDone: true }
if (Predicate.isUndefined(opts.stdin)) return cfg
if (typeof opts.stdin === "string") return { ...cfg, stream: opts.stdin }
if (Stream.isStream(opts.stdin)) return { ...cfg, stream: opts.stdin }
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/tool/bash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ const layer = Layer.effectDiscard(
const command = ChildProcess.make(input.command, [], {
cwd: target.canonical,
shell,
extendEnv: true,
env: { CI: "1", npm_config_yes: "true", GIT_TERMINAL_PROMPT: "0", NONINTERACTIVE: "1" },
stdin: "ignore",
detached: process.platform !== "win32",
forceKillAfter: Duration.seconds(3),
Expand Down
5 changes: 3 additions & 2 deletions packages/opencode/src/tool/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,11 @@ const ask = Effect.fn("ShellTool.ask")(function* (ctx: Tool.Context, scan: Scan,
})

function cmd(shell: string, command: string, cwd: string, env: NodeJS.ProcessEnv) {
const nonInteractiveEnv = { CI: "1", npm_config_yes: "true", GIT_TERMINAL_PROMPT: "0", NONINTERACTIVE: "1" }
if (process.platform === "win32" && Shell.ps(shell)) {
return ChildProcess.make(shell, ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", command], {
cwd,
env,
env: { ...env, ...nonInteractiveEnv },
stdin: "ignore",
detached: false,
})
Expand All @@ -303,7 +304,7 @@ function cmd(shell: string, command: string, cwd: string, env: NodeJS.ProcessEnv
return ChildProcess.make(command, [], {
shell,
cwd,
env,
env: { ...env, ...nonInteractiveEnv },
stdin: "ignore",
detached: process.platform !== "win32",
})
Expand Down
Loading