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

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/14714
Author: @carlos-zamora
Created: 1/20/2023
Status: Merged
Merged: 1/21/2023
Merged by: @undefined

Base: mainHead: dev/cazamor/signal-text-changed-crash


📝 Commits (5)

  • d83d7e1 Ensure TermControl is not closing when firing UIA events
  • 3ba6c4f Don't let TCAP read the value through TC
  • 72b61ef initialize _closing
  • 4ee1da3 Address feedback
  • b688639 winrt is not std

📊 Changes

3 files changed (+13 additions, -0 deletions)

View changed files

📝 src/cascadia/TerminalControl/TermControl.cpp (+5 -0)
📝 src/cascadia/TerminalControl/TermControlAutomationPeer.cpp (+7 -0)
📝 src/cascadia/TerminalControl/TermControlAutomationPeer.h (+1 -0)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/14714 **Author:** [@carlos-zamora](https://github.com/carlos-zamora) **Created:** 1/20/2023 **Status:** ✅ Merged **Merged:** 1/21/2023 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/cazamor/signal-text-changed-crash` --- ### 📝 Commits (5) - [`d83d7e1`](https://github.com/microsoft/terminal/commit/d83d7e121067d9790c849c4d5a0c859836281967) Ensure TermControl is not closing when firing UIA events - [`3ba6c4f`](https://github.com/microsoft/terminal/commit/3ba6c4f1ed2d5b9c65e1f04257addfd534a39045) Don't let TCAP read the value through TC - [`72b61ef`](https://github.com/microsoft/terminal/commit/72b61ef7f7e2191908f641126b5e01e6adf258d6) initialize _closing - [`4ee1da3`](https://github.com/microsoft/terminal/commit/4ee1da391545d00e70116ac548fe3b805a6024f3) Address feedback - [`b688639`](https://github.com/microsoft/terminal/commit/b688639691b690044c8953b887790513af337810) winrt is not std ### 📊 Changes **3 files changed** (+13 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+5 -0) 📝 `src/cascadia/TerminalControl/TermControlAutomationPeer.cpp` (+7 -0) 📝 `src/cascadia/TerminalControl/TermControlAutomationPeer.h` (+1 -0) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:39:26 +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#30227