Remove Terminal.refresh usage in InputHandler

This commit is contained in:
Daniel Imms
2019-12-18 10:30:49 +11:00
parent 94f5c37884
commit a2297a5fa6
3 changed files with 6 additions and 4 deletions
+5 -3
View File
@@ -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<number, number>();
public get onRequestRefreshRows(): IEvent<number, number> { return this._onRequestRefreshRows.event; }
private _onCursorMove = new EventEmitter<void>();
public get onCursorMove(): IEvent<void> { return this._onCursorMove.event; }
private _onLineFeed = new EventEmitter<void>();
@@ -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();
}
+1
View File
@@ -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);
-1
View File
@@ -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;
}