diff --git a/terminus-terminal/package.json b/terminus-terminal/package.json index c8997790..8aab6657 100644 --- a/terminus-terminal/package.json +++ b/terminus-terminal/package.json @@ -27,11 +27,11 @@ "runes": "^0.4.2", "slug": "^2.0.0", "uuid": "^3.3.2", - "xterm": "4.3.0", + "xterm": "^4.4.0-beta.15", "xterm-addon-fit": "^0.4.0-beta2", "xterm-addon-ligatures": "^0.2.1", "xterm-addon-search": "^0.4.0", - "xterm-addon-webgl": "^0.4.0", + "xterm-addon-webgl": "^0.5.0-beta.7", "zmodem.js": "^0.1.9" }, "peerDependencies": { diff --git a/terminus-terminal/src/frontends/xtermFrontend.ts b/terminus-terminal/src/frontends/xtermFrontend.ts index adce102e..ba006e62 100644 --- a/terminus-terminal/src/frontends/xtermFrontend.ts +++ b/terminus-terminal/src/frontends/xtermFrontend.ts @@ -23,6 +23,7 @@ export class XTermFrontend extends Frontend { protected enableWebGL = false private xterm: Terminal private configuredFontSize = 0 + private configuredLinePadding = 0 private zoom = 0 private resizeHandler: () => void private configuredTheme: ITheme = {} @@ -208,6 +209,7 @@ export class XTermFrontend extends Frontend { this.xterm.setOption('macOptionIsMeta', config.terminal.altIsMeta) this.xterm.setOption('scrollback', 100000) this.configuredFontSize = config.terminal.fontSize + this.configuredLinePadding = config.terminal.linePadding this.setFontSize() this.copyOnSelect = config.terminal.copyOnSelect @@ -247,7 +249,10 @@ export class XTermFrontend extends Frontend { } private setFontSize () { - this.xterm.setOption('fontSize', this.configuredFontSize * Math.pow(1.1, this.zoom)) + const scale = Math.pow(1.1, this.zoom) + this.xterm.setOption('fontSize', this.configuredFontSize * scale) + // eslint-disable-next-line @typescript-eslint/restrict-plus-operands + this.xterm.setOption('lineHeight', (this.configuredFontSize + this.configuredLinePadding * 2) / this.configuredFontSize * scale) this.resizeHandler() } diff --git a/terminus-terminal/yarn.lock b/terminus-terminal/yarn.lock index 00228dc0..07affad2 100644 --- a/terminus-terminal/yarn.lock +++ b/terminus-terminal/yarn.lock @@ -249,15 +249,15 @@ xterm-addon-search@^0.4.0: resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.4.0.tgz#a7beadb3caa7330eb31fb1f17d92de25537684a1" integrity sha512-g07qb/Z4aSfrQ25e6Z6rz6KiExm2DvesQXkx+eA715VABBr5VM/9Jf0INoCiDSYy/nn7rpna+kXiGVJejIffKg== -xterm-addon-webgl@^0.4.0: - version "0.4.1" - resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.4.1.tgz#c245f3310e7dbb0759e5eabaf125bbc9c9ab3955" - integrity sha512-z/YRmAji7y3ngjvSgoNCQxqYioarNplNqWv/KgtF4nRkBTWkhLHAg1QFNcH7XxUV/O8VuZoGAfp4LPX2hVz/yQ== +xterm-addon-webgl@^0.5.0-beta.7: + version "0.5.0-beta.7" + resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.5.0-beta.7.tgz#b7b95a362e942ad6f86fa286d7b7bd8ee3e7cf67" + integrity sha512-v6aCvhm1C6mvaurGwUYQfyhb2cAUyuVnzf3Ob/hy5ebtyzUj4wW0N9NbqDEJk67UeMi1lV2xZqrO5gNeTpVqFA== -xterm@4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.3.0.tgz#9a302efefe75172d4f7ea3afc20f9bd983f05027" - integrity sha512-6dnrC4nxgnRKQzIWwC5HA0mnT9/rpDPZflUIr24gdcdSMTKM1QQcor4qQ/xz4Zerz6AIL/CuuBPypFfzsB63dQ== +xterm@^4.4.0-beta.15: + version "4.4.0-beta.15" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.4.0-beta.15.tgz#5897bf79d29d1a2496ccd54665aded28c341b1cc" + integrity sha512-Dvz1CMCYKeoxPF7uIDznbRgUA2Mct49Bq93K2nnrDU0pDMM3Sf1t9fkEyz59wxSx5XEHVdLS80jywsz4sjXBjQ== yallist@^2.1.2: version "2.1.2"