Closed fasttime closed 5 months ago
Windows 10 Node.js 18.0.0 foreground-child 2.0.0
When the parent process terminates, it sends a SIGHUP signal to kill the child:
SIGHUP
https://github.com/tapjs/foreground-child/blob/a6704d99ffa6d379ba3b9599ea2df9bffbedd70c/index.js#L58
This is failing on Windows, apparently because SIGHUP is not supported:
Error: kill ENOSYS at ChildProcess.kill (node:internal/child_process:501:13)
The error message is not helpful, but a comment line in the source code of child_process explains it:
https://github.com/nodejs/node/blob/v18.0.0/lib/internal/child_process.js#L500-L501
/* The underlying platform doesn't support this signal. */ throw errnoException(err, 'kill');
Maybe send SIGTERM on Windows and SIGHUP on other platforms?
SIGTERM
Fixed by https://github.com/tapjs/foreground-child/pull/52 (along with many other things that made this module much more flaky and hard to work with).
Windows 10 Node.js 18.0.0 foreground-child 2.0.0
When the parent process terminates, it sends a
SIGHUP
signal to kill the child:https://github.com/tapjs/foreground-child/blob/a6704d99ffa6d379ba3b9599ea2df9bffbedd70c/index.js#L58
This is failing on Windows, apparently because
SIGHUP
is not supported:The error message is not helpful, but a comment line in the source code of child_process explains it:
https://github.com/nodejs/node/blob/v18.0.0/lib/internal/child_process.js#L500-L501
Maybe send
SIGTERM
on Windows andSIGHUP
on other platforms?