Skip to content

windows: handle GHOSTTY_ACTION_SELECTION_CHANGED → fire UIA TextSelectionChanged #550

Closed

Description

@deblasis

Context

The 2026-06 upstream sync (windows rebased onto ghostty-org/ghostty 5e872a6a6) added a new apprt action the C# app binds but does not yet handle:

  • Upstream: core: send selection_changed notification ghostty-org/ghostty#12902 (core: send selection_changed notification, c4e1ab888)
  • New enum value GHOSTTY_ACTION_SELECTION_CHANGED in include/ghostty.h (payload-less; fired on a selection state transition in src/Surface.zig).
  • macOS consumes it to post NSAccessibility .selectedTextChanged (macos/.../SurfaceView_AppKit.swift). GTK currently no-ops it.

Why it matters

This ties directly into the UIA text provider that just landed (#542–#545). Today the C# UIA layer has no push signal when the terminal selection changes, so assistive tech isn't notified. The Windows-native equivalent of macOS's .selectedTextChanged is raising the UIA TextPatternIdentifiers.TextSelectionChangedEvent from the terminal automation peer.

Suggested work

  • Add SELECTION_CHANGED to the action dispatch — windows/Ghostty.Core/Interop/GhosttyActions.cs + windows/Ghostty.Core/Input/ApprtActionMap.cs.
  • On receipt, read the current selection (existing ghostty_surface_has_selection / SelectionRange.cs plumbing) and raise TextSelectionChangedEvent from windows/Ghostty/Accessibility/TerminalAutomationPeer.cs.
  • Debounce/coalesce if the action fires rapidly during drag-select.
  • Smoke test under Narrator / an automation client that the event fires on select + clear.

References

  • apprt action plumbing: src/apprt/action.zig, include/ghostty.h (GHOSTTY_ACTION_SELECTION_CHANGED)
  • macOS consumer (reference impl): macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift

Surfaced during the 2026-06-25 upstream sync.

Activity

  1. added 2 commits that reference this issue on Jun 26, 2026
    a7e2f49
    e088054
  2. added a commit that references this issue on Jul 18, 2026
    4c8592f
  3. added a commit that references this issue on Jul 29, 2026
    4e0aa26
  4. added a commit that references this issue on Aug 10, 2026
    8fdd87a
  5. added a commit that references this issue on Aug 21, 2026
    e39bc6c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions