Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2015-12-28 16:34:42 -07:00
commit 35105f2a7c
1 changed files with 9 additions and 1 deletions

View File

@ -47,10 +47,13 @@ Door.prototype.run = function() {
self.client.term.write(decode(data, self.exeInfo.encoding));
};
var restored = false;
var restore = function(piped) {
if(self.client.term.output) {
if(!restored && self.client.term.output) {
self.client.term.output.unpipe(piped);
self.client.term.output.resume();
restored = true;
}
};
@ -133,6 +136,11 @@ Door.prototype.run = function() {
sockServer.close();
}
// we may not get a close
if('stdio' === self.exeInfo.io) {
restore(door);
}
door.removeAllListeners();
self.emit('finished');