fix(terminal): keep subpixel text on the retained replay frame (#39981)

Since the xterm 6.1.0-beta.336 rows stopped clipping with overflow:hidden,
Chromium draws the transparent replay copy over the opacity-0 screen with
grayscale antialiasing while the live screen keeps LCD text, so glyphs
shimmered for the replay hold on subpixel-AA systems. Paint the copy with
the terminal's opaque background so it keeps LCD text.

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
This commit is contained in:
OrcaWin
2026-11-08 14:11:48 -08:00
committed by GitHub
co-authored by OrcaWin
parent 774950d55d
commit 9d80e39bee
@@ -38,6 +38,12 @@ export function retainTerminalReplayFrame(
overflow: 'hidden',
pointerEvents: 'none'
})
// Why: Chromium drops subpixel (LCD) text for a transparent copy over the hidden screen.
const background =
screen.parentElement && getComputedStyle(screen.parentElement).backgroundColor
if (background?.startsWith('rgb(')) {
frame.style.backgroundColor = background
}
for (const child of screen.children) {
if (!child.matches('.xterm-helpers')) {
frame.append(child.cloneNode(true))