diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index 3d0adf6f99a..5a8b757c55c 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -120,6 +120,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach private _searchAddon?: SearchAddonType; private _unicode11Addon?: Unicode11AddonType; private _webglAddon?: WebglAddonType; + private _webglAddonCustomGlyphs?: boolean = false; private _serializeAddon?: SerializeAddonType; private _imageAddon?: ImageAddonType; private readonly _ligaturesAddon: MutableDisposable = this._register(new MutableDisposable()); @@ -228,7 +229,6 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach macOptionIsMeta: config.macOptionIsMeta, macOptionClickForcesSelection: config.macOptionClickForcesSelection, rightClickSelectsWord: config.rightClickBehavior === 'selectWord', - fastScrollModifier: 'alt', fastScrollSensitivity: config.fastScrollSensitivity, scrollSensitivity: config.mouseWheelScrollSensitivity, scrollOnEraseInDisplay: true, @@ -531,7 +531,6 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach this.raw.options.macOptionClickForcesSelection = config.macOptionClickForcesSelection; this.raw.options.rightClickSelectsWord = config.rightClickBehavior === 'selectWord'; this.raw.options.wordSeparator = config.wordSeparators; - this.raw.options.customGlyphs = config.customGlyphs; this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode; this.raw.options.rescaleOverlappingGlyphs = config.rescaleOverlappingGlyphs; @@ -790,12 +789,16 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach } private async _enableWebglRenderer(): Promise { - if (!this.raw.element || this._webglAddon) { + // Currently webgl options can only be specified on addon creation + if (!this.raw.element || this._webglAddon && this._webglAddonCustomGlyphs === this._terminalConfigurationService.config.customGlyphs) { return; } + this._webglAddonCustomGlyphs = this._terminalConfigurationService.config.customGlyphs; const Addon = await this._xtermAddonLoader.importAddon('webgl'); - this._webglAddon = new Addon(); + this._webglAddon = new Addon({ + customGlyphs: this._terminalConfigurationService.config.customGlyphs + }); try { this.raw.loadAddon(this._webglAddon); this._logService.trace('Webgl was loaded'); @@ -885,6 +888,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach // ignore } this._webglAddon = undefined; + this._webglAddonCustomGlyphs = undefined; this._refreshImageAddon(); // WebGL renderer cell dimensions differ from the DOM renderer, make sure the terminal // gets resized after the webgl addon is disposed diff --git a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts index 8bb60a711b0..819b3ec6c07 100644 --- a/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts +++ b/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts @@ -51,6 +51,7 @@ export class TerminalStickyScrollOverlay extends Disposable { private readonly _xtermAddonLoader = new XtermAddonImporter(); private _serializeAddon?: SerializeAddonType; private _webglAddon?: WebglAddonType; + private _webglAddonCustomGlyphs?: boolean; private _ligaturesAddon?: LigaturesAddonType; private _element?: HTMLElement; @@ -491,18 +492,19 @@ export class TerminalStickyScrollOverlay extends Disposable { drawBoldTextInBrightColors: o.drawBoldTextInBrightColors, minimumContrastRatio: o.minimumContrastRatio, tabStopWidth: o.tabStopWidth, - customGlyphs: o.customGlyphs, }; } @throttle(0) private async _refreshGpuAcceleration() { - if (this._shouldLoadWebgl() && !this._webglAddon) { + if (this._shouldLoadWebgl() && (!this._webglAddon || this._webglAddonCustomGlyphs !== this._terminalConfigurationService.config.customGlyphs)) { const WebglAddon = await this._xtermAddonLoader.importAddon('webgl'); if (this._store.isDisposed) { return; } - this._webglAddon = this._register(new WebglAddon()); + this._webglAddon = this._register(new WebglAddon({ + customGlyphs: this._terminalConfigurationService.config.customGlyphs + })); this._stickyScrollOverlay?.loadAddon(this._webglAddon); } else if (!this._shouldLoadWebgl() && this._webglAddon) { this._webglAddon.dispose();