Fix viewport staying pinned to the top after ESC[3J clears the scrollback (#6081)

This commit is contained in:
Taran
2026-08-10 11:38:58 +00:00
committed by GitHub
parent 8c9b9fdb9b
commit d6cfe3db5d
2 changed files with 53 additions and 0 deletions
+5
View File
@@ -1286,6 +1286,11 @@ export class InputHandler extends Disposable implements IInputHandler {
this._activeBuffer.lines.trimStart(scrollBackSize);
this._activeBuffer.ybase = Math.max(this._activeBuffer.ybase - scrollBackSize, 0);
this._activeBuffer.ydisp = Math.max(this._activeBuffer.ydisp - scrollBackSize, 0);
// isUserScrolling tracks the normal buffer's viewport, so ED3 on the alt
// screen must not touch it
if (this._activeBuffer === this._bufferService.buffers.normal) {
this._bufferService.isUserScrolling = false;
}
// Force a scroll event to refresh viewport
this._onScroll.fire(0);
}