Replace Xtermjs canvas with webgl (#1807)

Co-authored-by: MartinOscar <40749467+rmartinoscar@users.noreply.github.com>
This commit is contained in:
Charles 2025-10-14 20:35:26 -04:00 committed by GitHub
parent a65469b33b
commit 1a4fa5e67a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 11 deletions

View File

@ -17,10 +17,10 @@
"vite": "6.2.6" "vite": "6.2.6"
}, },
"dependencies": { "dependencies": {
"@xterm/addon-canvas": "^0.7.0",
"@xterm/addon-fit": "^0.10.0", "@xterm/addon-fit": "^0.10.0",
"@xterm/addon-search": "^0.15.0", "@xterm/addon-search": "^0.15.0",
"@xterm/addon-web-links": "^0.11.0", "@xterm/addon-web-links": "^0.11.0",
"@xterm/addon-webgl": "^0.18.0",
"@xterm/xterm": "^5.5.0", "@xterm/xterm": "^5.5.0",
"glob": "^11.0.3", "glob": "^11.0.3",
"xterm-addon-search-bar": "^0.2.0" "xterm-addon-search-bar": "^0.2.0"

View File

@ -3,11 +3,11 @@ import { FitAddon } from '@xterm/addon-fit';
import { WebLinksAddon } from '@xterm/addon-web-links'; import { WebLinksAddon } from '@xterm/addon-web-links';
import { SearchAddon } from '@xterm/addon-search'; import { SearchAddon } from '@xterm/addon-search';
import { SearchBarAddon } from 'xterm-addon-search-bar'; import { SearchBarAddon } from 'xterm-addon-search-bar';
import { CanvasAddon } from '@xterm/addon-canvas'; import { WebglAddon } from '@xterm/addon-webgl';
window.Xterm = { window.Xterm = {
Terminal, Terminal,
CanvasAddon, WebglAddon,
FitAddon, FitAddon,
WebLinksAddon, WebLinksAddon,
SearchAddon, SearchAddon,

View File

@ -76,19 +76,19 @@
theme: theme theme: theme
}; };
const { Terminal, FitAddon, WebLinksAddon, SearchAddon, SearchBarAddon, CanvasAddon } = window.Xterm; const { Terminal, FitAddon, WebLinksAddon, SearchAddon, SearchBarAddon, WebglAddon } = window.Xterm;
const terminal = new Terminal(options); const terminal = new Terminal(options);
const fitAddon = new FitAddon(); const fitAddon = new FitAddon();
const webLinksAddon = new WebLinksAddon(); const webLinksAddon = new WebLinksAddon();
const searchAddon = new SearchAddon(); const searchAddon = new SearchAddon();
const searchAddonBar = new SearchBarAddon({ searchAddon }); const searchAddonBar = new SearchBarAddon({ searchAddon });
const canvasAddon = new CanvasAddon(); const webglAddon = new WebglAddon();
terminal.loadAddon(fitAddon); terminal.loadAddon(fitAddon);
terminal.loadAddon(webLinksAddon); terminal.loadAddon(webLinksAddon);
terminal.loadAddon(searchAddon); terminal.loadAddon(searchAddon);
terminal.loadAddon(searchAddonBar); terminal.loadAddon(searchAddonBar);
terminal.loadAddon(canvasAddon); terminal.loadAddon(webglAddon);
terminal.open(document.getElementById('terminal')); terminal.open(document.getElementById('terminal'));

View File

@ -415,11 +415,6 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.7.tgz#4158d3105276773d5b7695cd4834b1722e4f37a8"
integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ== integrity sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==
"@xterm/addon-canvas@^0.7.0":
version "0.7.0"
resolved "https://registry.yarnpkg.com/@xterm/addon-canvas/-/addon-canvas-0.7.0.tgz#d3a3835f3634e0106e108661315ae14da23e8dd7"
integrity sha512-LF5LYcfvefJuJ7QotNRdRSPc9YASAVDeoT5uyXS/nZshZXjYplGXRECBGiznwvhNL2I8bq1Lf5MzRwstsYQ2Iw==
"@xterm/addon-fit@^0.10.0": "@xterm/addon-fit@^0.10.0":
version "0.10.0" version "0.10.0"
resolved "https://registry.yarnpkg.com/@xterm/addon-fit/-/addon-fit-0.10.0.tgz#bebf87fadd74e3af30fdcdeef47030e2592c6f55" resolved "https://registry.yarnpkg.com/@xterm/addon-fit/-/addon-fit-0.10.0.tgz#bebf87fadd74e3af30fdcdeef47030e2592c6f55"
@ -435,6 +430,11 @@
resolved "https://registry.yarnpkg.com/@xterm/addon-web-links/-/addon-web-links-0.11.0.tgz#f283513b8c713757bad8e3bf04b6becc3b4e585f" resolved "https://registry.yarnpkg.com/@xterm/addon-web-links/-/addon-web-links-0.11.0.tgz#f283513b8c713757bad8e3bf04b6becc3b4e585f"
integrity sha512-nIHQ38pQI+a5kXnRaTgwqSHnX7KE6+4SVoceompgHL26unAxdfP6IPqUTSYPQgSwM56hsElfoNrrW5V7BUED/Q== integrity sha512-nIHQ38pQI+a5kXnRaTgwqSHnX7KE6+4SVoceompgHL26unAxdfP6IPqUTSYPQgSwM56hsElfoNrrW5V7BUED/Q==
"@xterm/addon-webgl@^0.18.0":
version "0.18.0"
resolved "https://registry.yarnpkg.com/@xterm/addon-webgl/-/addon-webgl-0.18.0.tgz#9e927cee10af971595fb2a72fd4c3bc2819f0096"
integrity sha512-xCnfMBTI+/HKPdRnSOHaJDRqEpq2Ugy8LEj9GiY4J3zJObo3joylIFaMvzBwbYRg8zLtkO0KQaStCeSfoaI2/w==
"@xterm/xterm@^5.5.0": "@xterm/xterm@^5.5.0":
version "5.5.0" version "5.5.0"
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.5.0.tgz#275fb8f6e14afa6e8a0c05d4ebc94523ff775396" resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.5.0.tgz#275fb8f6e14afa6e8a0c05d4ebc94523ff775396"