mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
@@ -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 = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user