Skip to content

Accessibility: UIA text provider for the terminal grid - #542

Merged
deblasis merged 2 commits into
windowsfrom
a11y-uia-text-provider
Jun 19, 2026
Merged

deblasis merged 2 commits into
windowsfrom
a11y-uia-text-provider

Conversation

@deblasis

Copy link
Copy Markdown
Owner

Adds a Microsoft UI Automation text provider on the terminal surface so screen
readers (Narrator, NVDA, JAWS) can read terminal contents. This is the Windows
side of the VoiceOver support the macOS app already has (# 77).

It follows the macOS accessibility model directly. The document text comes from
ghostty_surface_read_text over the screen region, cached briefly because each
read takes the renderer lock. The selection range comes from
ghostty_surface_read_selection. There are no native changes; it binds C exports
that already exist.

The index math, range navigation, selection clamping, and the cache are pure
types in Ghostty.Core with unit tests. The WinUI automation peer and text range
provider are thin adapters over them.

This is the first of a short series. It covers the read model: screen text plus
the current selection. Color text attributes and throttled output announcements
follow in later changes. Windows high contrast for the terminal surface colors
is also a separate follow up.

Verified locally:

  • dotnet build and dotnet test pass on x64 (the new pure types add 27 tests).
  • Launched the app and confirmed through the automation tree that the terminal
    exposes the Text control type and the Text pattern, and that reading the
    document range returns the on-screen contents.

Left for manual testing: a real pass with NVDA and JAWS.

deblasis added 2 commits June 19, 2026 08:00
Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.
…race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
@deblasis
deblasis marked this pull request as ready for review June 19, 2026 06:36
@deblasis
deblasis merged commit 9411cdf into windows Jun 19, 2026
99 checks passed
deblasis added a commit that referenced this pull request Jun 25, 2026
* feat(windows): expose terminal surface as a UIA text provider

Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.

* refactor(a11y): name the screen-text cache TTL and document the read race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
deblasis added a commit that referenced this pull request Jul 18, 2026
* feat(windows): expose terminal surface as a UIA text provider

Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.

* refactor(a11y): name the screen-text cache TTL and document the read race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
deblasis added a commit that referenced this pull request Jul 29, 2026
* feat(windows): expose terminal surface as a UIA text provider

Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.

* refactor(a11y): name the screen-text cache TTL and document the read race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
deblasis added a commit that referenced this pull request Aug 10, 2026
* feat(windows): expose terminal surface as a UIA text provider

Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.

* refactor(a11y): name the screen-text cache TTL and document the read race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
deblasis added a commit that referenced this pull request Aug 21, 2026
* feat(windows): expose terminal surface as a UIA text provider

Add a Microsoft UI Automation Text provider on the terminal surface so
screen readers (Narrator, NVDA, JAWS) can read terminal contents, ported
from the macOS VoiceOver model. Screen text comes from read_text(SCREEN)
cached 500ms; the selection range comes from read_selection offsets.

Index, range navigation, selection clamping, and the cache are pure types
in Ghostty.Core covered by unit tests; the WinUI peer and range provider
are thin adapters over them. No native changes; binds existing exports.

* refactor(a11y): name the screen-text cache TTL and document the read race

Promote the 500ms cache duration to a named constant and note the
accepted cross-thread read-vs-teardown race on the screen-text accessor,
mirroring the macOS surface.
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