diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index 0f7521436a184..fb5f0ddaf9420 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -341,8 +341,6 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach } } - this._refreshLigaturesAddon(); - if (!this.raw.element || !this.raw.textarea) { throw new Error('xterm elements not set after open'); } @@ -365,6 +363,8 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach } }, { passive: true })); + this._refreshLigaturesAddon(); + this._attached = { container, options }; // Screen must be created at this point as xterm.open is called return this._attached?.container.querySelector('.xterm-screen')!; @@ -411,14 +411,16 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach showTopBorder: true, }; this._updateSmoothScrolling(); - if (this._attached?.options.enableGpu) { - if (this._shouldLoadWebgl()) { - this._enableWebglRenderer(); - } else { - this._disposeOfWebglRenderer(); + if (this._attached) { + if (this._attached.options.enableGpu) { + if (this._shouldLoadWebgl()) { + this._enableWebglRenderer(); + } else { + this._disposeOfWebglRenderer(); + } } + this._refreshLigaturesAddon(); } - this._refreshLigaturesAddon(); } private _updateSmoothScrolling() { diff --git a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts index 22b5188027719..7b3d3de337148 100644 --- a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts +++ b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts @@ -110,14 +110,6 @@ export class TerminalStickyScrollOverlay extends Disposable { })); this._refreshGpuAcceleration(); - this._xtermAddonLoader.importAddon('ligatures').then(LigaturesAddon => { - if (this._store.isDisposed || !this._stickyScrollOverlay) { - return; - } - this._ligaturesAddon = new LigaturesAddon(); - this._stickyScrollOverlay.loadAddon(this._ligaturesAddon); - }); - this._register(configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(TERMINAL_CONFIG_SECTION)) { this._syncOptions(); @@ -402,6 +394,14 @@ export class TerminalStickyScrollOverlay extends Disposable { this._stickyScrollOverlay.open(this._element); + this._xtermAddonLoader.importAddon('ligatures').then(LigaturesAddon => { + if (this._store.isDisposed || !this._stickyScrollOverlay) { + return; + } + this._ligaturesAddon = new LigaturesAddon(); + this._stickyScrollOverlay.loadAddon(this._ligaturesAddon); + }); + // Scroll to the command on click this._register(addStandardDisposableListener(hoverOverlay, 'click', () => { if (this._xterm && this._currentStickyCommand) {