tapjs/foreground-child

SIGHUP is not supported on Windows

Closed this issue · 1 comments

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:

child.kill('SIGHUP')

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?

isaacs commented

Fixed by #52 (along with many other things that made this module much more flaky and hard to work with).