Backup restore() when 'close' fails to fire
This commit is contained in:
parent
0658d5af52
commit
db014c16bf
10
core/door.js
10
core/door.js
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue