Skip to content

The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.

fix(terminal): Render with xterm's DOM renderer

l0ng-ai99b4f8bdf66b
diff --git a/package.json b/package.json
index 541e0f6e7..8323b2461 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,6 @@
"@tauri-apps/plugin-opener": "^2",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-search": "^0.16.0",
- "@xterm/addon-webgl": "^0.19.0",
"@xterm/xterm": "^6.0.0",
"anser": "^2.3.5",
"clsx": "^2.1.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e9818574c..76c7e499a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -65,9 +65,6 @@ importers:
'@xterm/addon-search':
specifier: ^0.16.0
version: 0.16.0
- '@xterm/addon-webgl':
- specifier: ^0.19.0
- version: 0.19.0
'@xterm/xterm':
specifier: ^6.0.0
version: 6.0.0
@@ -918,9 +915,6 @@ packages:
resolution: {integrity: sha512-9OeuBFu0/uZJPu+9AHKY6g/w0Czyb/Ut0A5t79I4ULoU4IfU5BEpPFVGQxP4zTTMdfZEYkVIRYbHBX1xWwjeSA==}
- '@xterm/[email protected]':
- resolution: {integrity: sha512-b3fMOsyLVuCeNJWxolACEUED0vm7qC0cy4wRvf3oURSzDTYVQiGPhTnhWZwIHdvC48Y+oLhvYXnY4XDXPoJo6A==}
-
resolution: {integrity: sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==}
@@ -2657,8 +2651,6 @@ snapshots:
'@xterm/[email protected]': {}
- '@xterm/[email protected]': {}
-
'@xterm/[email protected]': {}
diff --git a/src/features/terminal/session.ts b/src/features/terminal/session.ts
index a098d950a..ccdc84de2 100644
--- a/src/features/terminal/session.ts
+++ b/src/features/terminal/session.ts
@@ -286,9 +286,10 @@ export class TerminalSession {
if (this.host.parentElement !== container) container.appendChild(this.host);
if (!this.opened) {
this.opened = true;
+ // xterm's DOM renderer: the WebGL one rasterizes glyphs per background, so
+ // selected text rendered at a visibly different weight than the rest.
this.term.open(this.host);
this.term.textarea?.addEventListener("focus", () => this.opts.onFocus(this.key));
- void this.loadRenderer();
}
this.resizeObserver?.disconnect();
this.resizeObserver = new ResizeObserver(() => this.scheduleFit());
@@ -302,19 +303,6 @@ export class TerminalSession {
if (this.host.parentElement === container) container.removeChild(this.host);
}
- private async loadRenderer() {
- // WebGL when available; xterm's DOM renderer is the built-in fallback.
- try {
- const { WebglAddon } = await import("@xterm/addon-webgl");
- if (this.disposed) return;
- const webgl = new WebglAddon();
- webgl.onContextLoss(() => webgl.dispose());
- this.term.loadAddon(webgl);
- } catch {
- /* no WebGL: keep the DOM renderer */
- }
- }
-
private scheduleFit() {
if (this.fitRaf) return;
const run = () => {