Skip to content

Commit b3f3cf1

Browse files
authored
Merge pull request #5208 from Tyriar/5207
Set liga font feature when ligatures is enabled
2 parents 3d9b107 + 77885ed commit b3f3cf1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

addons/addon-ligatures/src/LigaturesAddon.ts

+7
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi {
3131
}
3232

3333
public activate(terminal: Terminal): void {
34+
if (!terminal.element) {
35+
throw new Error('Cannot activate LigaturesAddon before open is called');
36+
}
3437
this._terminal = terminal;
3538
this._characterJoinerId = enableLigatures(terminal, this._fallbackLigatures);
39+
terminal.element.style.fontFeatureSettings = '"liga" on, "calt" on';
3640
}
3741

3842
public dispose(): void {
3943
if (this._characterJoinerId !== undefined) {
4044
this._terminal?.deregisterCharacterJoiner(this._characterJoinerId);
4145
this._characterJoinerId = undefined;
4246
}
47+
if (this._terminal?.element) {
48+
this._terminal.element.style.fontFeatureSettings = '';
49+
}
4350
}
4451
}

0 commit comments

Comments
 (0)