Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
private _serializeAddon?: SerializeAddonType;
private _imageAddon?: ImageAddonType;
private readonly _ligaturesAddon: MutableDisposable<LigaturesAddonType> = this._register(new MutableDisposable());
private readonly _ligaturesAddonConfig?: ILigatureOptions;
private _ligaturesAddonConfig?: ILigatureOptions;

private readonly _attachedDisposables = this._register(new DisposableStore());
private readonly _anyTerminalFocusContextKey: IContextKey<boolean>;
Expand Down Expand Up @@ -895,18 +895,21 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
const ligaturesConfig = this._terminalConfigurationService.config.fontLigatures;
let shouldRecreateWebglRenderer = false;
if (ligaturesConfig?.enabled) {
if (this._ligaturesAddon.value && !equals(ligaturesConfig, this._ligaturesAddonConfig)) {
const ligatureOptions: ILigatureOptions = {
fontFeatureSettings: ligaturesConfig.featureSettings,
fallbackLigatures: ligaturesConfig.fallbackLigatures,
};
if (this._ligaturesAddon.value && !equals(ligatureOptions, this._ligaturesAddonConfig)) {
this._ligaturesAddon.clear();
this._ligaturesAddonConfig = undefined;
}
if (!this._ligaturesAddon.value) {
const LigaturesAddon = await this._xtermAddonLoader.importAddon('ligatures');
if (this._store.isDisposed) {
return;
}
this._ligaturesAddon.value = this._instantiationService.createInstance(LigaturesAddon, {
fontFeatureSettings: ligaturesConfig.featureSettings,
fallbackLigatures: ligaturesConfig.fallbackLigatures,
});
this._ligaturesAddon.value = this._instantiationService.createInstance(LigaturesAddon, ligatureOptions);
this._ligaturesAddonConfig = ligatureOptions;
this.raw.loadAddon(this._ligaturesAddon.value);
shouldRecreateWebglRenderer = true;
}
Expand All @@ -915,6 +918,7 @@ export class XtermTerminal extends Disposable implements IXtermTerminal, IDetach
return;
}
this._ligaturesAddon.clear();
this._ligaturesAddonConfig = undefined;
shouldRecreateWebglRenderer = true;
}

Expand Down