Skip to content

Commit 5e9ffb4

Browse files
authored
Merge pull request #5328 from Tyriar/5327_scroll
Refresh viewport after clear or ED
2 parents 1771825 + e9587cf commit 5e9ffb4

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/browser/CoreBrowserTerminal.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,13 @@ export class CoreBrowserTerminal extends CoreTerminal implements ITerminal {
532532
this.textarea!.focus();
533533
this.textarea!.select();
534534
}));
535-
this._register(this._onScroll.event(() => this._selectionService!.refresh()));
535+
this._register(Event.any(
536+
this._onScroll.event,
537+
this._inputHandler.onScroll
538+
)(() => {
539+
this._selectionService!.refresh();
540+
this._viewport?.queueSync();
541+
}));
536542

537543
this._register(this._instantiationService.createInstance(BufferDecorationRenderer, this.screenElement));
538544
this._register(addDisposableListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService!.handleMouseDown(e)));

src/browser/Viewport.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ export class Viewport extends Disposable {
9393
].join('\n');
9494
}));
9595

96-
this._register(this._bufferService.onResize(() => this._queueSync()));
97-
this._register(this._bufferService.buffers.onBufferActivate(() => this._queueSync()));
96+
this._register(this._bufferService.onResize(() => this.queueSync()));
97+
this._register(this._bufferService.buffers.onBufferActivate(() => this.queueSync()));
9898
this._register(this._bufferService.onScroll(() => this._sync()));
9999

100100
this._register(this._scrollableElement.onScroll(e => this._handleScroll(e)));
@@ -126,7 +126,7 @@ export class Viewport extends Disposable {
126126
};
127127
}
128128

129-
private _queueSync(ydisp?: number): void {
129+
public queueSync(ydisp?: number): void {
130130
// Update state
131131
if (ydisp !== undefined) {
132132
this._latestYDisp = ydisp;

0 commit comments

Comments
 (0)