Repository navigation
perf(terminal): stop xterm redrawing the rows libghostty covers, and let screen readers read them - #2959
Conversation
…let screen readers read libghostty's rows
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 10 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
…erm draw while the pane is folded
|
Review round on a80e055 (omo BLOCK, Codex no HIGH). Resolved in the next commit:
|
|
Second review round on defed19: omo and Codex, no HIGH. Per the lane rule (one extra fix round), the rest is recorded here instead of another round:
Validation on defed19: |
|
Merge note: all GitHub checks green at this head, check fast passed, omo + Codex second round: no HIGH (the two reproduced MEDIUMs are #2963; LOWs in the PR comment), threads resolved. Low-end CPU x6 runaway output, ABBA: ghostty on now ties or beats xterm (median 10.5 s vs 10.8 s, stalls 4 vs 7). NVDA reads new output with ghostty on (not with xterm). |
…#2976) ## What Settings > Terminal > Draw with libghostty (#2908) is on by default. - It still only draws on a herdr-core server (`terminal-history`, as the desktop app runs); on herdr and mirrored panes xterm.js draws exactly as before. - The setting stays, per device. A device that turned it off stays off: a stored `false` is kept, only a missing or invalid value means on. Note: since #2908 every settings save writes this key, so a device that saved any setting on a main build after #2908 also has `false` stored and stays off; released versions never had the key, so their users get the new default. ## Gates (step 1 checklist, measured on isolated hc 0.1.17 + this stack) | Gate | Result | |---|---| | Phone first load (slow 4G 1.6 Mbps/150 ms, CPU x4, fresh profile, median of 5) | off 7,510 ms / on 7,918 ms: +408 ms, within +0.5 s (wasm served br since #2953: 1.11 MB -> 345 KB, re-open fetches no wasm) | | Low-end phone frames (CPU x6, `seq 1 200000`, ABBA) | after #2959 on is at or below off: median finish 10.5 s vs 10.8 s, stalls > 50 ms 4 vs 7 | | Screen reader (real NVDA 2026.2, Windows 11 VM, Edge 156) | on: NVDA reads new output; off (xterm, screen reader mode off): reads nothing. Known follow-ups in #2963 | | iOS long-press copy (iOS 27 Simulator, Safari) | **provisionally equal**: neither xterm nor libghostty shows a selection/copy menu on a 1.6 s long-press (driven with simctl + AXe touch). Pending one manual check once Simulator components are installed on the test Mac. Copy keeps working through the key bar's copy button and OSC 52 (#2925) | ## Validation - `bun test src/lib/settings`: pass (the two tests that pinned the old default now pin the new one: missing/invalid means on, a stored `false` stays off, the key stays out of the whole-record save). - `bun scripts/terminal-ghostty-demo-regression.ts`: pass (herdr-core pane drawn with libghostty, herdr's own and off stay xterm). - `bun run check fast`: pass (exit 0) on this head
What
Settings > Terminal > Draw with libghostty (#2908) cost more than plain xterm on a busy pane, and screen readers read nothing from it.
renderRowsis a no-op while the layer draws (restored, with a full refresh, on dispose). Those hidden rows were about a third of the extra cost.aria-hidden(pictures and cursor still are), and a visually hidden polite live region announces the lines a program writes, as xterm's screen reader mode does: the latest frame's new lines, at most 20, never the screen a pane opens on.xterm.js has no public way to stop its renderer, so this reaches
_core._renderService._rendererthe waylib/terminalReplies.tsreaches_core.coreService; without it, xterm simply keeps drawing as before.Measurements
Isolated hc 0.1.17 core + this branch's server, headless Chromium, 390x844 touch, CPU throttled 6x,
seq 1 200000in a herdr-core pane, runs alternating off/on (ABBA):(the machine was shared and loaded, so absolute numbers move between batches; within a batch on is now at or below off.)
Real NVDA 2026.2 in the Windows 11 test VM, Edge 156, the pane printing two marker lines: with the setting on NVDA spoke
ECHOLINE-1 ECHOLINE-2 $; with it off (xterm, screen reader mode off) it spoke nothing for the same output.Validation
bun scripts/terminal-ghostty-demo-regression.ts: new assertions: the screen a pane opens on is not announced, a line the program writes is, and xterm's hidden rows no longer receive it. They fail on main's overlay (nothing announced).bun run check fast: pass (exit 0) on this head (merged with origin/main).