diff --git a/addons/addon-ligatures/src/LigaturesAddon.ts b/addons/addon-ligatures/src/LigaturesAddon.ts index cb58930359..47fbc32370 100644 --- a/addons/addon-ligatures/src/LigaturesAddon.ts +++ b/addons/addon-ligatures/src/LigaturesAddon.ts @@ -31,8 +31,12 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi { } public activate(terminal: Terminal): void { + if (!terminal.element) { + throw new Error('Cannot activate LigaturesAddon before open is called'); + } this._terminal = terminal; this._characterJoinerId = enableLigatures(terminal, this._fallbackLigatures); + terminal.element.style.fontFeatureSettings = '"liga" on, "calt" on'; } public dispose(): void { @@ -40,5 +44,8 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi { this._terminal?.deregisterCharacterJoiner(this._characterJoinerId); this._characterJoinerId = undefined; } + if (this._terminal?.element) { + this._terminal.element.style.fontFeatureSettings = ''; + } } }