diff --git a/src/InputHandler.ts b/src/InputHandler.ts index 7a0a6ac3..cfd2e1ec 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -128,6 +128,8 @@ export class InputHandler extends Disposable implements IInputHandler { private _utf8Decoder: Utf8ToUtf32 = new Utf8ToUtf32(); private _workCell: CellData = new CellData(); + private _onRequestRefreshRows = new EventEmitter(); + public get onRequestRefreshRows(): IEvent { return this._onRequestRefreshRows.event; } private _onCursorMove = new EventEmitter(); public get onCursorMove(): IEvent { return this._onCursorMove.event; } private _onLineFeed = new EventEmitter(); @@ -372,7 +374,7 @@ export class InputHandler extends Disposable implements IInputHandler { } // Refresh any dirty rows accumulated as part of parsing - this._terminal.refresh(this._dirtyRowService.start, this._dirtyRowService.end); + this._onRequestRefreshRows.fire(this._dirtyRowService.start, this._dirtyRowService.end); } public print(data: Uint32Array, start: number, end: number): void { @@ -1465,7 +1467,7 @@ export class InputHandler extends Disposable implements IInputHandler { case 47: // alt screen buffer case 1047: // alt screen buffer this._bufferService.buffers.activateAltBuffer(this._terminal.eraseAttrData()); - this._terminal.refresh(0, this._bufferService.rows - 1); + this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1); if (this._terminal.viewport) { this._terminal.viewport.syncScrollArea(); } @@ -1639,7 +1641,7 @@ export class InputHandler extends Disposable implements IInputHandler { if (params.params[i] === 1049) { this.restoreCursor(); } - this._terminal.refresh(0, this._bufferService.rows - 1); + this._onRequestRefreshRows.fire(0, this._bufferService.rows - 1); if (this._terminal.viewport) { this._terminal.viewport.syncScrollArea(); } diff --git a/src/Terminal.ts b/src/Terminal.ts index 5c08a709..bb67ac1f 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -277,6 +277,7 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp // Register input handler and refire/handle events this._inputHandler = new InputHandler(this, this._bufferService, this._coreService, this._dirtyRowService, this._logService, this.optionsService, this._coreMouseService); + this._inputHandler.onRequestRefreshRows((start, end) => this.refresh(start, end)); this._inputHandler.onCursorMove(() => this._onCursorMove.fire()); this._inputHandler.onLineFeed(() => this._onLineFeed.fire()); this.register(this._inputHandler); diff --git a/src/Types.d.ts b/src/Types.d.ts index f4d3a556..063331dd 100644 --- a/src/Types.d.ts +++ b/src/Types.d.ts @@ -56,7 +56,6 @@ export interface IInputHandlingTerminal { resize(x: number, y: number): void; reset(): void; showCursor(): void; - refresh(start: number, end: number): void; handleTitle(title: string): void; }