From bd700fe5157b062c1fb1933f3d936e4db84a59f7 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Sun, 14 Jul 2024 09:05:18 -0700 Subject: [PATCH] Allow refreshing all rows without creating object --- src/browser/CoreBrowserTerminal.ts | 2 +- src/common/InputHandler.ts | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/browser/CoreBrowserTerminal.ts b/src/browser/CoreBrowserTerminal.ts index ac6bd3b4..235cb79f 100644 --- a/src/browser/CoreBrowserTerminal.ts +++ b/src/browser/CoreBrowserTerminal.ts @@ -160,7 +160,7 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal { // Setup InputHandler listeners this.register(this._inputHandler.onRequestBell(() => this._onBell.fire())); - this.register(this._inputHandler.onRequestRefreshRows((e) => this.refresh(e.start, e.end))); + this.register(this._inputHandler.onRequestRefreshRows((e) => this.refresh(e?.start ?? 0, e?.end ?? (this.rows - 1)))); this.register(this._inputHandler.onRequestSendFocus(() => this._reportFocus())); this.register(this._inputHandler.onRequestReset(() => this.reset())); this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type))); diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 84a3161e..861b759d 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -134,7 +134,7 @@ export class InputHandler extends Disposable implements IInputHandler { private readonly _onRequestBell = this.register(new Emitter()); public readonly onRequestBell = this._onRequestBell.event; - private readonly _onRequestRefreshRows = this.register(new Emitter<{ start: number, end: number }>()); + private readonly _onRequestRefreshRows = this.register(new Emitter<{ start: number, end: number } | undefined>()); public readonly onRequestRefreshRows = this._onRequestRefreshRows.event; private readonly _onRequestReset = this.register(new Emitter()); public readonly onRequestReset = this._onRequestReset.event; @@ -1946,10 +1946,7 @@ export class InputHandler extends Disposable implements IInputHandler { case 1047: // alt screen buffer this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()); this._coreService.isCursorInitialized = true; - this._onRequestRefreshRows.fire({ - start: 0, - end: this._bufferService.rows - 1 - }); + this._onRequestRefreshRows.fire(undefined); this._onRequestSyncScrollBar.fire(); break; case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste) @@ -2177,10 +2174,7 @@ export class InputHandler extends Disposable implements IInputHandler { this.restoreCursor(); } this._coreService.isCursorInitialized = true; - this._onRequestRefreshRows.fire({ - start: 0, - end: this._bufferService.rows - 1 - }); + this._onRequestRefreshRows.fire(undefined); this._onRequestSyncScrollBar.fire(); break; case 2004: // bracketed paste mode (https://cirw.in/blog/bracketed-paste)