mirror of
https://github.com/Eugeny/tabby.git
synced 2025-10-04 14:04:56 +00:00
prevent recovered tabs from blanking out
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { Frontend } from './frontend'
|
||||
import { Terminal, ITheme } from 'xterm'
|
||||
import * as fit from 'xterm/src/addons/fit/fit'
|
||||
import * as ligatures from 'xterm-addon-ligatures-tmp'
|
||||
import { fit } from 'xterm/src/addons/fit/fit'
|
||||
import { enableLigatures } from 'xterm-addon-ligatures'
|
||||
import 'xterm/lib/xterm.css'
|
||||
import './xterm.css'
|
||||
import deepEqual = require('deep-equal')
|
||||
|
||||
Terminal.applyAddon(fit)
|
||||
Terminal.applyAddon(ligatures)
|
||||
|
||||
/** @hidden */
|
||||
export class XTermFrontend extends Frontend {
|
||||
enableResizing = true
|
||||
@@ -75,7 +72,7 @@ export class XTermFrontend extends Frontend {
|
||||
|
||||
this.resizeHandler = () => {
|
||||
try {
|
||||
(this.xterm as any).fit()
|
||||
fit(this.xterm)
|
||||
} catch {
|
||||
// tends to throw when element wasn't shown yet
|
||||
}
|
||||
@@ -146,11 +143,14 @@ export class XTermFrontend extends Frontend {
|
||||
configure (): void {
|
||||
let config = this.configService.store
|
||||
|
||||
setTimeout(() => {
|
||||
setImmediate(() => {
|
||||
if (this.xterm.cols && this.xterm.rows) {
|
||||
this.xtermCore.charMeasure.measure(this.xtermCore.options)
|
||||
this.xtermCore.renderer._updateDimensions()
|
||||
this.resizeHandler()
|
||||
}
|
||||
})
|
||||
|
||||
this.xterm.setOption('fontFamily', `"${config.terminal.font}", "monospace-fallback", monospace`)
|
||||
this.xterm.setOption('bellStyle', config.terminal.bell)
|
||||
this.xterm.setOption('cursorStyle', {
|
||||
@@ -185,7 +185,7 @@ export class XTermFrontend extends Frontend {
|
||||
}
|
||||
|
||||
if (config.terminal.ligatures && this.xterm.element) {
|
||||
(this.xterm as any).enableLigatures()
|
||||
enableLigatures(this.xterm)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user