diff --git a/lib/pty.js b/lib/pty.js index df707a5..445fbb8 100644 --- a/lib/pty.js +++ b/lib/pty.js @@ -8,6 +8,7 @@ var net = require('net'); var tty = require('tty'); var extend = require('extend'); var pty = require('../build/Release/pty.node'); +var waitpid = require("waitpid"); /** * Terminal @@ -322,6 +323,7 @@ Terminal.prototype.destroy = function() { Terminal.prototype.kill = function(sig) { try { process.kill(this.pid, sig || 'SIGHUP'); + waitpid(this.pid); } catch(e) { ; } diff --git a/package.json b/package.json index 3797d52..1fccc81 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pty.js", "description": "Pseudo terminals for node.", "author": "Christopher Jeffrey", - "version": "0.2.4", + "version": "0.2.5", "main": "./index.js", "repository": "git://github.com/chjj/pty.js.git", "homepage": "https://github.com/chjj/pty.js", @@ -24,7 +24,8 @@ ], "dependencies": { "extend": "~1.2.1", - "nan": "~1.0.0" + "nan": "~1.0.0", + "waitpid": "~0.1.1" }, "devDependencies": { "mocha": "~1.16.2"