Skip to content

Commit 4de6f1c

Browse files
authored
Merge pull request #3203 from meganrogge/master
cache buffer to fix VS Code issue #111562
2 parents f8f7e7e + 8baff9b commit 4de6f1c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/browser/public/Terminal.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export class Terminal implements ITerminalApi {
1818
private _core: ITerminal;
1919
private _addonManager: AddonManager;
2020
private _parser: IParser | undefined;
21+
private _buffer: BufferNamespaceApi | undefined;
2122

2223
constructor(options?: ITerminalOptions) {
2324
this._core = new TerminalCore(options);
@@ -58,7 +59,10 @@ export class Terminal implements ITerminalApi {
5859
public get cols(): number { return this._core.cols; }
5960
public get buffer(): IBufferNamespaceApi {
6061
this._checkProposedApi();
61-
return new BufferNamespaceApi(this._core.buffers);
62+
if (!this._buffer) {
63+
return new BufferNamespaceApi(this._core.buffers);
64+
}
65+
return this._buffer;
6266
}
6367
public get markers(): ReadonlyArray<IMarker> {
6468
this._checkProposedApi();

0 commit comments

Comments
 (0)