Accessibility: announce new terminal output to screen readers#544
Merged
Conversation
When a screen reader is attached and the terminal is focused, new output is spoken via a UIA notification. A poll on the UI thread feeds the cached screen text to a pure announcer that diffs out new complete lines, holds partial lines, batches, and summarizes large bursts. Gated on the OS screen-reader flag and focus, so it is completely inert otherwise. The diff policy is pure logic in Ghostty.Core with unit tests. No native changes beyond one Win32 call for the screen-reader flag.
Cache the automation peer on the control and drive the announce timer off the owner's Loaded/Unloaded so re-querying a loaded control reuses one peer and one timer instead of accumulating them. Also: singular 'new line' summary, simpler change check, and a note that announcements degrade to silence when output exceeds the scrollback buffer.
22 tasks
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.
Completes the screen reader support for the terminal: new output is now spoken
as it arrives when a screen reader is attached.
On Windows, a screen reader does not automatically read new text in a plain UIA
text control, so command output was readable on navigation but not heard. This
adds a conservative announcement path. A short timer on the UI thread feeds the
cached screen text to a pure diff policy that announces only complete new lines,
holds a partial line until its newline arrives, batches new lines into one
notification, and summarizes large bursts as a count. The result is raised as a
UIA notification.
It is gated to be completely inert unless an assistive technology is present: the
timer body returns early unless the OS reports a screen reader is running and the
surface is focused and foreground. Users without a screen reader see no behavior
change and pay nothing beyond a cached read.
macOS has no equivalent here. Its accessibility is pull only, with no
announcements and no timer, because VoiceOver reads the value on its own. This
announcement path is a Windows specific addition.
The diff, batch, and summary policy is a pure type in Ghostty.Core with unit
tests. The only native addition is a single Win32 call to read the screen reader
flag. No Zig changes.
Verified locally:
runs the announcement path live with no crash and the output present for the
policy to consume. The flag is restored afterward.
Left for manual testing: a real pass with NVDA and JAWS to hear the spoken output.