fix: ensure shell cmds can be properly aborted (#2339)

This commit is contained in:
Aiden Cline
2025-08-31 12:48:30 -05:00
committed by GitHub
parent e9826e8a22
commit 029612d8d5

View File

@@ -1141,6 +1141,7 @@ export namespace Session {
const proc = spawn(shell, args, {
cwd: app.path.cwd,
signal: abort.signal,
detached: true,
stdio: ["ignore", "pipe", "pipe"],
env: {
...process.env,
@@ -1148,6 +1149,11 @@ export namespace Session {
},
})
abort.signal.addEventListener("abort", () => {
if (!proc.pid) return
process.kill(-proc.pid)
})
let output = ""
proc.stdout?.on("data", (chunk) => {