Skip to content

Limit the a11y live region for output without line feeds - #6199

Open
0x48Maciek wants to merge 1 commit into
xtermjs:masterfrom
0x48Maciek:fix/a11y-live-region-no-line-feeds
Open

0x48Maciek wants to merge 1 commit into
xtermjs:masterfrom
0x48Maciek:fix/a11y-live-region-no-line-feeds

Conversation

@0x48Maciek

Copy link
Copy Markdown

In screen reader mode the live region stops taking output after 20 line feeds. Output that positions the cursor instead never reaches that limit, so every printed character is appended until the terminal loses focus or a key is pressed. The live region is a 1px-wide element, so each append re-lays-out text that keeps growing. Full-screen TUIs hit this constantly. With Claude Code's fullscreen mode in VS Code, the whole window freezes within seconds of scrolling and only recovers when the terminal is blurred (e.g. by switching terminal tabs).

This also counts a row's worth of characters as a line, so the existing limit applies.

Replaying a recording of Claude Code's fullscreen mode scrolling (200x50, WebGL, headless Chromium) three times, 9 s each:

live region max main thread stall
Before 145K → 611K → 977K chars 0.1 s → 3.1 s → 9.9 s
After 62 chars < 70 ms

Related: anthropics/claude-code#84712

🤖 Generated with Claude Code

The live region only counted line feeds towards the "too much output"
limit, so output that positions the cursor instead (eg. a TUI redrawing
the viewport) appended every printed character to it until the terminal
lost focus or a key was pressed. A row's worth of characters now also
counts as a line.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant