You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clean up the entireCommands child process group by default #5303
Commands that spawn child processes can sometimes leave sub-sub-processes lingering if the invoked Command does not reap them on its own.
Counterintuitively, I think we should be leveraging the detached: true flag by default to address this. This would be in-line with the scoped managed resource approach that Effect is already taking with Command execution today. Whether we should offer an escape hatch for this default or not I don't have an opinion on.
I'm proposing that we set detached: true by default for non-windows systems.
detached: process.platform!=="win32"
This will cause the new process to be assigned as a leader of a new process group that can then be terminated in its entirety at our discretion.
Instead of just forwarding a kill signal to the process handle (handle.kill(signal)), we'd then utilise taskkill with /T on windows (kill the entire process tree) and process.kill(-pid, signal) (negative pid to kill the entire process group) on non-windows systems.
Closing as implemented. The current Node command executor starts non-Windows commands detached and cleans up the process group/tree via process.kill(-pid, signal) or taskkill /T on Windows.
Activity
fubhy commentedon Jul 9, 2026
Closing as implemented. The current Node command executor starts non-Windows commands detached and cleans up the process group/tree via
process.kill(-pid, signal)ortaskkill /Ton Windows.