From 780f9a31ff8320b97ee1bfd3c388cb2bd07784cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20B=C5=82asiak?= Date: Thu, 21 Nov 2024 22:46:06 +0100 Subject: [PATCH] Update src/common/InputHandler.ts Co-authored-by: jerch --- src/common/InputHandler.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 489736917b..81cf086cc2 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -1221,15 +1221,12 @@ export class InputHandler extends Disposable implements IInputHandler { break; case 2: if (this._optionsService.rawOptions.scrollOnDisplayErase) { - let fouldLastLineToKeep = false; j = this._bufferService.rows; - const x = this._activeBuffer.getBlankLine(this._eraseAttrData()); - while (j > 0 && !fouldLastLineToKeep) { - j--; + this._dirtyRowTracker.markRangeDirty(0, j - 1); + while (j--) { const currentLine = this._activeBuffer.lines.get(this._activeBuffer.ybase + j); - if (currentLine?.translateToString() !== x.translateToString()) { - fouldLastLineToKeep = true; - this._dirtyRowTracker.markRangeDirty(0, j); + if (currentLine?.getTrimmedLength()) { + break; } } for (; j >= 0; j--) {