Merge pull request #5390 from xtermjs/anthonykim1/fixTeleportAltBuffer

Fix scrollbar teleport after exiting alt buffer
This commit is contained in:
Daniel Imms
2025-08-29 05:41:52 -07:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -20,6 +20,7 @@ export class MockBufferService implements IBufferService {
public buffers: IBufferSet = {} as any;
public onResize: Event<{ cols: number, rows: number }> = new Emitter<{ cols: number, rows: number }>().event;
public onScroll: Event<number> = new Emitter<number>().event;
private readonly _onScroll = new Emitter<number>();
public isUserScrolling: boolean = false;
constructor(
public cols: number,
@@ -27,6 +28,10 @@ export class MockBufferService implements IBufferService {
optionsService: IOptionsService = new MockOptionsService()
) {
this.buffers = new BufferSet(optionsService, this);
// Listen to buffer activation events and automatically fire scroll events
this.buffers.onBufferActivate(e => {
this._onScroll.fire(e.activeBuffer.ydisp);
});
}
public scrollPages(pageCount: number): void {
throw new Error('Method not implemented.');
+3
View File
@@ -37,6 +37,9 @@ export class BufferService extends Disposable implements IBufferService {
this.cols = Math.max(optionsService.rawOptions.cols || 0, MINIMUM_COLS);
this.rows = Math.max(optionsService.rawOptions.rows || 0, MINIMUM_ROWS);
this.buffers = this._register(new BufferSet(optionsService, this));
this._register(this.buffers.onBufferActivate(e => {
this._onScroll.fire(e.activeBuffer.ydisp);
}));
}
public resize(cols: number, rows: number): void {