Repository navigation
feat(windows): handle SELECTION_CHANGED → UIA TextSelectionChanged - #553
Merged
Merged
Conversation
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>
deblasis
force-pushed
the
feat/windows-selection-changed-uia
branch
from
June 26, 2026 08:38
9dd50cc to
a7e2f49
Compare
deblasis
marked this pull request as ready for review
June 26, 2026 08:38
deblasis
added a commit
that referenced
this pull request
Jul 18, 2026
…553) Wire upstream's payload-less GHOSTTY_ACTION_SELECTION_CHANGED to the Windows UIA text provider so assistive tech re-queries the selection, mirroring macOS posting NSAccessibility .selectedTextChanged. 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. Pins the new ordinal in GhosttyActionsLayoutTests. Closes #550.
deblasis
added a commit
that referenced
this pull request
Jul 29, 2026
…553) Wire upstream's payload-less GHOSTTY_ACTION_SELECTION_CHANGED to the Windows UIA text provider so assistive tech re-queries the selection, mirroring macOS posting NSAccessibility .selectedTextChanged. 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. Pins the new ordinal in GhosttyActionsLayoutTests. Closes #550.
deblasis
added a commit
that referenced
this pull request
Aug 10, 2026
…553) Wire upstream's payload-less GHOSTTY_ACTION_SELECTION_CHANGED to the Windows UIA text provider so assistive tech re-queries the selection, mirroring macOS posting NSAccessibility .selectedTextChanged. 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. Pins the new ordinal in GhosttyActionsLayoutTests. Closes #550.
deblasis
added a commit
that referenced
this pull request
Aug 21, 2026
…553) Wire upstream's payload-less GHOSTTY_ACTION_SELECTION_CHANGED to the Windows UIA text provider so assistive tech re-queries the selection, mirroring macOS posting NSAccessibility .selectedTextChanged. 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. Pins the new ordinal in GhosttyActionsLayoutTests. Closes #550.
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.
Closes #550. Stacked on #552 (base =
fix/windows-action-tag-realign); review/merge that first.What
Upstream ghostty-org#12902 added a payload-less
GHOSTTY_ACTION_SELECTION_CHANGED, fired on a selection state transition. macOS posts NSAccessibility.selectedTextChanged; this wires the Windows equivalent so the UIA text provider (added in #542–#545) notifies assistive tech.Flow:
GhosttyHost.OnAction→ resolveTerminalControl→RaiseSelectionChanged()→TerminalAutomationPeer.RaiseSelectionChangedEvent()→RaiseAutomationEvent(TextPatternOnTextSelectionChanged).Changes
GhosttyActions.cs: addSelectionChanged = 51to the dispatched subset (+ pin inGhosttyActionsLayoutTests).GhosttyHost.cs: dispatch case (payload-less, resolve-guarded, same shape asSetTitle/MouseShape).TerminalControl.xaml.cs:RaiseSelectionChanged()— no-ops when no peer exists (no AT client).TerminalAutomationPeer.cs:RaiseSelectionChangedEvent()— raises the UIA event, guarded byListenerExists.Design notes
Ghostty.slnGhostty.Tests→GhosttyActionsLayoutTestsgreenAutomationEvents.TextPatternOnTextSelectionChangedis the correct WinUI 3 event id (highest-risk line — API name verified against UWP/WinUI UIA, not compiled here)TextSelectionChanged🤖 Generated with Claude Code