diff --git a/lib/pty.js b/lib/pty.js index 801ba27..3eff68e 100644 --- a/lib/pty.js +++ b/lib/pty.js @@ -292,6 +292,15 @@ Terminal.prototype.setEncoding = function(enc) { } }; +Terminal.prototype.prependListener = function(type, func) { + if (type === 'close') { + this._internalee.prependListener('close', func); + return this; + } + this.socket.prependListener(type, func); + return this; +}; + Terminal.prototype.addListener = Terminal.prototype.on = function(type, func) { if (type === 'close') {