Generate report on Windows after proc.kill('SIGINT')`
See original GitHub issueHi,
Thank you for a great tool. I try to use node-clinic
on my Windows 10 machine, but after I try to end my process using CTRL+C, nothing happens, the only process ends, without a report.
I clone node-clinic
repo and make npm link
to it, and change this line https://github.com/nearform/node-clinic-doctor/blob/master/index.js#L75 into
/*if (os.platform() !== 'win32') */ proc.kill('SIGINT')
, to kill process on windows platform using SIGINT
signal, and after i press CTRL+C in my command line, process end and report was analyzed.
I saw the comment in the code, but I don’t know why, but at the moment it works for me when I use this
process.once('SIGINT', function () { proc.kill('SIGINT') })
C:\Projekty\Learn\node-clinic>npm version
{ clinic: '1.0.3',
npm: '6.1.0',
ares: '1.10.1-DEV',
cldr: '32.0',
http_parser: '2.8.0',
icu: '60.1',
modules: '57',
napi: '3',
nghttp2: '1.32.0',
node: '8.11.3',
openssl: '1.0.2o',
tz: '2017c',
unicode: '10.0',
uv: '1.19.1',
v8: '6.2.414.54',
zlib: '1.2.11' }
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Go Graceful SIGINT killing - enzircle
In this problem, you are given a process that runs indefinitely and blocks the program. The only way to stop the program is...
Read more >What is the Windows equivalent of process.on('SIGINT') in ...
This problem randomly occured to me today and I think it has something to do with the readline module itself. I couldn't do...
Read more >Node.js process.kill() Method - GeeksforGeeks
'SIGHUP' is generated when the console window is closed. Return value : The process.kill() method will throw an error if the target pid...
Read more >Process | Node.js v19.3.0 Documentation
'SIGHUP' is generated on Windows when the console window is closed, and on other platforms under various similar conditions. See signal(7) . It...
Read more >kill-with-style - npm
When using on Windows make sure to make .timeout and .checkInterval larger, especially when there is need to kill multiple children.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @DylanC , I tested with
clinic doctor
version v5.0.0, and it works! 😃. Thank you 😃Hi @mafintosh ,
So I try to made a fork https://github.com/lukaszewczak/node-clinic-doctor, and put this change in the code (https://github.com/lukaszewczak/node-clinic-doctor/blob/master/index.js#L70)
And to test it I change two scripts:
exit
event to test if it was killed bySIGINT
signalIn general child process can’t capture the signal on Windows, it is just killed immediately by it, just like in the docs , this is why the previous writen test can not pass.
But
'SIGINT' from the terminal is supported on all platforms
, which is the case in [node-clinic-doctor] (https://github.com/lukaszewczak/node-clinic-doctor/blob/master/index.js#L70) where the code is listening forSIGINT
signal on the main process, not a child process.I hope that my attempt to explain this behavior is quite understandable.