diff --git a/src/browser/Terminal.ts b/src/browser/Terminal.ts index b072c92c..57099ac2 100644 --- a/src/browser/Terminal.ts +++ b/src/browser/Terminal.ts @@ -957,11 +957,6 @@ export class Terminal extends CoreTerminal implements ITerminal { } public addMarker(cursorYOffset: number): IMarker | undefined { - // Disallow markers on the alt buffer - if (this.buffer !== this.buffers.normal) { - return; - } - return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); } diff --git a/src/common/buffer/BufferSet.test.ts b/src/common/buffer/BufferSet.test.ts index 894ebb20..944b8c15 100644 --- a/src/common/buffer/BufferSet.test.ts +++ b/src/common/buffer/BufferSet.test.ts @@ -71,4 +71,14 @@ describe('BufferSet', () => { assert.equal(bufferSet.active.y, 10); }); }); + + describe('markers', () => { + it('should clear the markers when the buffer is switched', () => { + bufferSet.activateAltBuffer(); + bufferSet.alt.addMarker(1); + assert.equal(bufferSet.alt.markers.length, 1); + bufferSet.activateNormalBuffer(); + assert.equal(bufferSet.alt.markers.length, 0); + }); + }); }); diff --git a/src/common/buffer/BufferSet.ts b/src/common/buffer/BufferSet.ts index de220e8f..7d07cec8 100644 --- a/src/common/buffer/BufferSet.ts +++ b/src/common/buffer/BufferSet.ts @@ -83,6 +83,7 @@ export class BufferSet extends Disposable implements IBufferSet { // The alt buffer should always be cleared when we switch to the normal // buffer. This frees up memory since the alt buffer should always be new // when activated. + this._alt.clearAllMarkers(); this._alt.clear(); this._activeBuffer = this._normal; this._onBufferActivate.fire({