macOS: Basic Read-Only Accessibility Integration #7601
Merged
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.
This integrates with macOS accessibility APIs to expose Ghostty terminal structure and content.
This is a very, very bare implementation and the terminal contents currently reported are the full screen and scrollback which is way too much for realistic human accessibility use. The target use case for this PR is to enable automated tooling (namely, AI screen readers). However, this is all groundwork we'll need to iterate and improve the accessibility work anyways.
To make this work, I also replatformed some of our hacky C APIs onto a more robust
ghostty_surface_read_text
API that can now read arbitrary ranges of the screen into C strings for consumers to use. This will be useful in more places going forward (hint hint).Before
Accessibility tooling can't read anything, Ghostty has no attributes, no contents, just shows up as a square.
After
A lot of metadata, including the screen contents as text.
Also, split hierarchies are navigable:
CleanShot.2025-06-15.at.14.09.51.mp4