Skip to content

Commit

Permalink
Set liga font feature when ligatures is enabled
Browse files Browse the repository at this point in the history
Fixes #5207
  • Loading branch information
Tyriar committed Nov 4, 2024
1 parent 3d9b107 commit 77885ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/addon-ligatures/src/LigaturesAddon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,21 @@ 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 {
if (this._characterJoinerId !== undefined) {
this._terminal?.deregisterCharacterJoiner(this._characterJoinerId);
this._characterJoinerId = undefined;
}
if (this._terminal?.element) {
this._terminal.element.style.fontFeatureSettings = '';
}
}
}

0 comments on commit 77885ed

Please sign in to comment.