cache buffer

This commit is contained in:
meganrogge
2021-01-04 08:31:22 -08:00
parent f8f7e7e4c1
commit 8baff9bade
+5 -1
View File
@@ -18,6 +18,7 @@ export class Terminal implements ITerminalApi {
private _core: ITerminal;
private _addonManager: AddonManager;
private _parser: IParser | undefined;
private _buffer: BufferNamespaceApi | undefined;
constructor(options?: ITerminalOptions) {
this._core = new TerminalCore(options);
@@ -58,7 +59,10 @@ export class Terminal implements ITerminalApi {
public get cols(): number { return this._core.cols; }
public get buffer(): IBufferNamespaceApi {
this._checkProposedApi();
return new BufferNamespaceApi(this._core.buffers);
if (!this._buffer) {
return new BufferNamespaceApi(this._core.buffers);
}
return this._buffer;
}
public get markers(): ReadonlyArray<IMarker> {
this._checkProposedApi();