Repository navigation
core: send selection_changed notification - #12902
Merged
Merged
Conversation
The core had no signal to the apprt when the active selection changed, so a consumer (e.g. a screen reader) kept reading a stale selection until some unrelated query refreshed it. This change adds a payload-less selection_changed action that's fired on a selection state transition. The apprt reads the current selection through the normal read path. This consolidates selection state changes so the notification fires consistently: all sites route through setSelection rather than calling screen.select directly, including the mouse paths that previously bypassed it for clipboard timing. The new setSelectionAndCopy extends setSelection with the additional 'copy_on_select' behavior. On macOS, this posts .ghosttySelectionDidChange, which is debounced before posting a NSAccessibility .selectedTextChanged notification. GTK has no consumer yet and no-ops the action.
jparise
force-pushed
the
ax-selection-changed
branch
from
June 2, 2026 23:38
c67f2ca to
c4e1ab8
Compare
bo2themax
previously requested changes
Jun 3, 2026
bo2themax
approved these changes
Jun 3, 2026
mitchellh
approved these changes
Jun 4, 2026
Contributor
|
Appreciate the smaller PRs towards a11y improvements. Thank you. |
This was referenced Jun 25, 2026
windows: handle GHOSTTY_ACTION_SELECTION_CHANGED → fire UIA TextSelectionChanged
deblasis/wintty#550
Closed
deblasis
added a commit
to deblasis/wintty
that referenced
this pull request
Jun 26, 2026
Upstream ghostty-org#12902 added a payload-less GHOSTTY_ACTION_SELECTION_CHANGED, fired on a selection state transition; the apprt is expected to read the current selection and notify accessibility. macOS posts NSAccessibility .selectedTextChanged -- this wires the Windows equivalent. Add SelectionChanged (51) to the dispatched GhosttyActionTag subset and route it through GhosttyHost.OnAction to the surface's TerminalControl, which forwards to its UIA TerminalAutomationPeer. The peer raises TextPatternOnTextSelectionChanged, guarded by ListenerExists so it is inert without an attached AT client; the control no-ops when no peer has been created (no AT client). Pins the new ordinal in GhosttyActionsLayoutTests. Closes #550. Not built locally: the C# app only compiles on Windows (CsWin32). Needs a Windows build plus a screen-reader/automation-client smoke test, and confirmation that AutomationEvents.TextPatternOnTextSelectionChanged is the correct WinUI 3 event id. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The core had no signal to the apprt when the active selection changed, so a consumer (e.g. a screen reader) kept reading a stale selection until some unrelated query refreshed it.
This change adds a payload-less selection_changed action that's fired on a selection state transition. The apprt reads the current selection through the normal read path.
This consolidates selection state changes so the notification fires consistently: all sites route through setSelection rather than calling screen.select directly, including the mouse paths that previously bypassed it for clipboard timing.
The new setSelectionAndCopy extends setSelection with the additional 'copy_on_select' behavior.
On macOS, this posts .ghosttySelectionDidChange, which is debounced before posting a NSAccessibility .selectedTextChanged notification.
GTK has no consumer yet and no-ops the action.
See: #9932