improve screen.setTerminal.
This commit is contained in:
parent
210c33d076
commit
3df75398a0
|
@ -261,7 +261,21 @@ Screen.prototype.__defineSetter__('terminal', function(terminal) {
|
|||
});
|
||||
|
||||
Screen.prototype.setTerminal = function(terminal) {
|
||||
return this.program.setTerminal(terminal);
|
||||
var entered = !!this.program.isAlt
|
||||
, result;
|
||||
|
||||
if (entered) {
|
||||
this.program._buf = '';
|
||||
this.leave();
|
||||
}
|
||||
|
||||
result = this.program.setTerminal(terminal);
|
||||
|
||||
if (entered) {
|
||||
this.enter();
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
Screen.prototype.enter = function() {
|
||||
|
|
Loading…
Reference in New Issue