fix(spawn): use detached:true so children are immune to terminal SIGINT
Children now get their own process group. Terminal Ctrl+C only reaches the parent, which then does orderly tree-kill while children are still alive and the process tree is intact.
This commit is contained in:
@@ -119,7 +119,7 @@ export class Smartshell {
|
||||
shell: false, // SECURITY: Never use shell with untrusted input
|
||||
cwd: process.cwd(),
|
||||
env: options.env || process.env,
|
||||
detached: false,
|
||||
detached: true, // Own process group — immune to terminal SIGINT, managed by smartexit
|
||||
signal: options.signal,
|
||||
});
|
||||
|
||||
@@ -342,7 +342,7 @@ export class Smartshell {
|
||||
shell: true,
|
||||
cwd: process.cwd(),
|
||||
env: options.env || process.env,
|
||||
detached: false,
|
||||
detached: true, // Own process group — immune to terminal SIGINT, managed by smartexit
|
||||
signal: options.signal,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user