-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signal Handling for windows #13
Comments
All signals should be tested on all platforms. If SIGTERM doesn't exist on Windows, the equivalent signal should be used for windows termination. The main problem is that our tests assume 2 things are important here:
So does this mean that if we switch to using The solution might be something like this:
|
Fixing As for The powershell/cmd terminals may be doing something different when doing |
Specification
Windows handles it's signals differently. According to https://nodejs.org/docs/latest-v16.x/api/process.html#processkillpid-signal.
"On Windows, where POSIX signals do not exist, the signal argument will be ignored, and the process will be killed forcefully and abruptly (similar to 'SIGKILL'). See Signal Events for more details.".
However acording to the node signals https://nodejs.org/docs/latest-v16.x/api/process.html#signal-events
SIGHUP
is generated on Windows when the console window is closed, and on other platforms under various similar conditions. See signal(7). It can have a listener installed, however Node.js will be unconditionally terminated by Windows about 10 seconds later. On non-Windows platforms, the default behavior of SIGHUP is to terminate Node.js, but once a listener has been installed its default behavior will be removed.SIGBREAK
is delivered on Windows when Ctrl+Break is pressed. On non-Windows platforms, it can be listened on, but there is no way to send or generate it.SIGINT
from the terminal is supported on all platforms, and can usually be generated with Ctrl+C (though this may be configurable). It is not generated when terminal raw mode is enabled and Ctrl+C is used.'SIGINT' from the terminal is supported on all platforms, and can usually be generated with Ctrl+C (though this may be configurable). It is not generated when terminal raw mode is enabled and Ctrl+C is used.SIGTERM
is not supported on Windows, it can be listened on.So we need to make sure that all of the signals that windows can produce are supported by Polykey. Then we need to create new tests testing that this works.
Additional context
Tasks
ctrl + C
in the terminal running it.The text was updated successfully, but these errors were encountered: