feat(app): render terminals via WebGL, attached only to the active pane#446
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
replaceChildren()DOM-node rebuild of an entire terminal row on every content update — its own source explicitly calls this renderer "not meant to be particularly fast" and describes it as "a fallback for when the webgl addon is slow." A CLI repeatedly recoloring the same status line forces that expensive rebuild on every frame.@xterm/addon-webgl(0.19.0) as the primary renderer. This is a real fix, not a workaround — it's xterm.js's own intended fast path — and also a general performance improvement for all terminal output, not just this one animation.TerminalPanegets a new requiredactiveprop; a dedicated effect attachesWebglAddonwhen the pane becomes active and disposes it (releasing the GPU context) when it goes inactive.onContextLoss: disposes and falls back to the default DOM renderer for the rest of that pane's active session — no regression on unsupported/locked-down GPUs, no retry loop.Test plan
tsc --noEmitcleanpnpm test— 152 passed (no new tests: the added logic is a thin, non-pure attach/detach effect over real xterm/WebGL objects, consistent with this repo's convention of only unit-testing extracted pure logic — flagging for co1 in case a different call is warranted here)tauri devby koit: no rendering breakage or hangs across 3 teams / ~10 panes, switching tabs/teams repeatedly. Visual comparison of shimmer smoothness and the DOM->WebGL anti-aliasing change (ClearType-ish -> more grayscale) also confirmed fine by koit directly.