diff --git a/cli.js b/cli.js index 513bc48..0d5bf2d 100755 --- a/cli.js +++ b/cli.js @@ -14,8 +14,11 @@ var input = process.argv.slice(2); var bin = require('./'); if (bin !== null) { - spawn(bin, input, {stdio: 'inherit'}) + var child = spawn(bin, input, {stdio: 'inherit'}) .on('exit', process.exit); + process.on('SIGTERM', function() { + child.kill(); + }); } else { throw new Error('Platform not supported.'); }