Fix session exiting (#560)

* Fix session exiting

* Restore original flow and just remove listeners on session when exiting

* Prevent sending data from pty after session exited
This commit is contained in:
chabou 2016-08-19 22:19:04 +02:00 committed by Leo Lamprecht
parent 445306c0cc
commit f0b049b2e3

View file

@ -43,6 +43,9 @@ module.exports = class Session extends EventEmitter {
});
this.pty.stdout.on('data', (data) => {
if (this.ended) {
return;
}
this.emit('data', data.toString('utf8'));
});