[PR #14714] Ensure TermControl is not closing when firing UIA events #30230

Open
opened 2026-01-31 09:39:27 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/14714

State: closed
Merged: Yes


The SignalTextChanged crash seems to be occurring due to the TermControlAutomationPeer being destructed by the time the UIA event is actually dispatched. Even though we're already checking if TCAP and TermControl still exist, it could be that the TermControl is being closed as text is being output.

The proposed fix here is to record when the closing process starts and exposing that information directly to the TCAP. If TCAP sees that we're in the process of closing, don't bother sending a UIA event.

Closes #13978

**Original Pull Request:** https://github.com/microsoft/terminal/pull/14714 **State:** closed **Merged:** Yes --- The `SignalTextChanged` crash seems to be occurring due to the `TermControlAutomationPeer` being destructed by the time the UIA event is actually dispatched. Even though we're already checking if TCAP and TermControl still exist, it could be that the TermControl is being closed as text is being output. The proposed fix here is to record when the closing process starts and exposing that information directly to the TCAP. If TCAP sees that we're in the process of closing, don't bother sending a UIA event. Closes #13978
claunia added the pull-request label 2026-01-31 09:39:27 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30230