From c575fa5ece0b2513582a4362635bf3f05280e4c4 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Wed, 18 Sep 2019 12:47:41 +0200 Subject: [PATCH] build fix --- terminus-terminal/src/frontends/xtermFrontend.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index 0d3b8acd..5ef29753 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -2,7 +2,7 @@ import { Frontend, SearchOptions } from './frontend' import { Terminal, ITheme } from 'xterm' import { getCSSFontFamily } from '../utils' import { FitAddon } from 'xterm-addon-fit' -import { enableLigatures } from 'xterm-addon-ligatures' +import { LigaturesAddon } from 'xterm-addon-ligatures' import { SearchAddon } from 'xterm-addon-search' import { WebglAddon } from 'xterm-addon-webgl' import './xterm.css' @@ -29,6 +29,7 @@ export class XTermFrontend extends Frontend { private copyOnSelect = false private search = new SearchAddon() private fitAddon = new FitAddon() + private ligaturesAddon: LigaturesAddon private opened = false constructor () { @@ -119,10 +120,6 @@ export class XTermFrontend extends Frontend { this.xterm.loadAddon(new WebglAddon()) } - if (this.configService.store.terminal.ligatures) { - enableLigatures(this.xterm) - } - this.ready.next(null) this.ready.complete() @@ -225,8 +222,9 @@ export class XTermFrontend extends Frontend { this.configuredTheme = theme } - if (this.opened && config.terminal.ligatures) { - enableLigatures(this.xterm) + if (this.opened && config.terminal.ligatures && !this.ligaturesAddon) { + this.ligaturesAddon = new LigaturesAddon() + this.xterm.loadAddon(this.ligaturesAddon) } }