/** * Copyright (c) 2018 The xterm.js authors. All rights reserved. * @license MIT */ import type { Terminal } from '@xterm/xterm'; import type { LigaturesAddon as ILigaturesApi } from '@xterm/addon-ligatures'; import { enableLigatures } from '.'; import { ILigatureOptions } from './Types'; export interface ITerminalAddon { activate(terminal: Terminal): void; dispose(): void; } export class LigaturesAddon implements ITerminalAddon , ILigaturesApi { private readonly _fallbackLigatures: string[]; private readonly _fontFeatureSettings?: string; private _terminal: Terminal | undefined; private _characterJoinerId: number | undefined; constructor(options?: Partial) { // Source: calt set from https://github.com/be5invis/Iosevka?tab=readme-ov-file#ligations this._fallbackLigatures = (options?.fallbackLigatures || [ '<--', '<---', '<<-', '<-', '->', '->>', '-->', '--->', '<==', '<===', '<<=', '<=', '=>', '=>>', '==>', '===>', '>=', '>>=', '<->', '<-->', '<--->', '<---->', '<=>', '<==>', '<===>', '<====>', '::', ':::', '<~~', '', '/>', '~~>', '==', '!=', '/=', '~=', '<>', '===', '!==', '!===', '<:', ':=', '*=', '*+', '<*', '<*>', '*>', '<|', '<|>', '|>', '+*', '=*', '=:', ':>', '/*', '*/', '+++', '