test program: ``` var phridge = require('phridge'); var ph = phridge.spawn(); ph.then(function (ph) { console.log('phantomJS started'); }); process.on('SIGINT', function () { phridge.disposeAll().then(function () { console.log('phantomJS closed'); process.exit(); }); }); ``` output: ``` phantomJS started ^C events.js:72 throw er; // Unhandled 'error' event ^ Error: write EPIPE at errnoException (net.js:901:11) at Object.afterWrite (net.js:718:19) ``` Change `SIGINT` to `SIGTERM`, use a timeout or anything else to trigger the shutdown and it works fine. Maybe SIGINT closes stdin/stdout? Interestingly it also works if I do `process.emit('SIGINT')`. I am using Linux (bash). Thanks.
test program:
output:
Change
SIGINTtoSIGTERM, use a timeout or anything else to trigger the shutdown and it works fine. Maybe SIGINT closes stdin/stdout?Interestingly it also works if I do
process.emit('SIGINT').I am using Linux (bash).
Thanks.