Fix saved cursor position on resize of alt screen

This commit is contained in:
Vadim Zakondyrin
2019-06-10 14:27:48 +06:00
parent 566f5944dd
commit 311f6b6e84
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -1916,7 +1916,7 @@ export class InputHandler extends Disposable implements IInputHandler {
*/
public saveCursor(params: number[]): void {
this._terminal.buffer.savedX = this._terminal.buffer.x;
this._terminal.buffer.savedY = this._terminal.buffer.y;
this._terminal.buffer.savedY = this._terminal.buffer.ybase + this._terminal.buffer.y;
this._terminal.buffer.savedCurAttrData.fg = this._terminal.curAttrData.fg;
this._terminal.buffer.savedCurAttrData.bg = this._terminal.curAttrData.bg;
}
@@ -1929,7 +1929,7 @@ export class InputHandler extends Disposable implements IInputHandler {
*/
public restoreCursor(params: number[]): void {
this._terminal.buffer.x = this._terminal.buffer.savedX || 0;
this._terminal.buffer.y = this._terminal.buffer.savedY || 0;
this._terminal.buffer.y = Math.max(this._terminal.buffer.savedY - this._terminal.buffer.ybase, 0);
this._terminal.curAttrData.fg = this._terminal.buffer.savedCurAttrData.fg;
this._terminal.curAttrData.bg = this._terminal.buffer.savedCurAttrData.bg;
}