mirror of
https://github.com/google-gemini/gemini-cli
synced 2026-04-21 21:47:19 +00:00
fix(core): disable detached mode in Bun to prevent immediate SIGHUP of child processes
This commit is contained in:
parent
d1a062bcc4
commit
ebfeb9e4e4
1 changed files with 7 additions and 1 deletions
|
|
@ -529,12 +529,18 @@ export class ShellExecutionService {
|
|||
cwd: finalCwd,
|
||||
} = prepared;
|
||||
|
||||
// Bun's child_process does not properly call setsid() for detached
|
||||
// processes, leaving children in the parent's session without a
|
||||
// controlling terminal. They receive SIGHUP immediately. Disable
|
||||
// detached mode in Bun; killProcessGroup already falls back to
|
||||
// direct-pid kill when the group kill fails.
|
||||
const isBun = 'bun' in process.versions;
|
||||
const child = cpSpawn(finalExecutable, finalArgs, {
|
||||
cwd: finalCwd,
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
windowsVerbatimArguments: isWindows ? false : undefined,
|
||||
shell: false,
|
||||
detached: !isWindows,
|
||||
detached: !isWindows && !isBun,
|
||||
env: finalEnv,
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue