From 519336f545a9581404441fd94edea17c666bb95f Mon Sep 17 00:00:00 2001 From: Ni Rui Date: Fri, 22 Jul 2022 15:48:00 +0800 Subject: [PATCH] Code clean up for `ui/widgets/screen_console.vue` --- ui/widgets/screen_console.vue | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ui/widgets/screen_console.vue b/ui/widgets/screen_console.vue index 0a5330f..673ce67 100644 --- a/ui/widgets/screen_console.vue +++ b/ui/widgets/screen_console.vue @@ -109,7 +109,7 @@ import FontFaceObserver from "fontfaceobserver"; import { Terminal } from "xterm"; import { WebLinksAddon } from "xterm-addon-web-links"; -import { WebglAddon } from "xterm-addon-webgl"; +// import { WebglAddon } from "xterm-addon-webgl"; import { FitAddon } from "xterm-addon-fit"; import { isNumber } from "../commands/common.js"; import { consoleScreenKeys } from "./screen_console_keys.js"; @@ -144,13 +144,12 @@ class Term { fontFamily: termTypeFace + ", " + termFallbackTypeFace, fontSize: this.fontSize, logLevel: process.env.NODE_ENV === "development" ? "info" : "off", + theme: { + background: this.control.activeColor(), + }, }); this.fit = new FitAddon(); - this.term.options.theme = { - background: this.control.activeColor(), - }; - this.term.onData((data) => { if (this.closed) { return; @@ -365,7 +364,7 @@ class Term { return; } - this.term.setOption("fontFamily", value); + this.term.options.fontFamily = value; this.refit(); } @@ -379,7 +378,7 @@ class Term { } this.fontSize += 2; - this.term.setOption("fontSize", this.fontSize); + this.term.options.fontSize = this.fontSize; this.refit(); } @@ -393,7 +392,7 @@ class Term { } this.fontSize -= 2; - this.term.setOption("fontSize", this.fontSize); + this.term.options.fontSize = this.fontSize; this.refit(); }