[PR #12735] [Conhost] Notify UIA when letter deleted via backspace #29218

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

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

State: closed
Merged: Yes


Summary of the Pull Request

Fixes a bug in ConHost where Narrator wouldn't read the deleted letter after the user pressed backspace.

References

MSFT:31748387

Detailed Description of the Pull Request / Additional comments

WriteCharsLegacy() already calls NotifyAccessibilityEventing() when text is inserted into the buffer (see code). However, when backspace is pressed, the entire if-condition is skipped over, resulting in the accessibility event not being fired. WriteCharsLegacy() has a separate branch that is dedicated to handling backspace, so I added a call to the relevant logic to notify UIA at the end of that.

Validation Steps Performed

Backspace deletes a character and Narrator reads it
Backspace still works with NVDA and JAWS (unchanged behavior)
if the input buffer had wrapped text, the above scenario works as expected
scenario works for CMD, PowerShell Core, and WSL

**Original Pull Request:** https://github.com/microsoft/terminal/pull/12735 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Fixes a bug in ConHost where Narrator wouldn't read the deleted letter after the user pressed backspace. ## References MSFT:31748387 ## Detailed Description of the Pull Request / Additional comments `WriteCharsLegacy()` already calls `NotifyAccessibilityEventing()` when text is inserted into the buffer ([see code](https://github.com/microsoft/terminal/blob/855e1360c0ff810decf862f1d90e15b5f49e7bbd/src/host/_stream.cpp#L559-L563)). However, when backspace is pressed, the entire if-condition is skipped over, resulting in the accessibility event not being fired. `WriteCharsLegacy()` has a separate branch that is dedicated to handling backspace, so I added a call to the relevant logic to notify UIA at the end of that. ## Validation Steps Performed ✅ <kbd>Backspace</kbd> deletes a character and Narrator reads it ✅ <kbd>Backspace</kbd> still works with NVDA and JAWS (unchanged behavior) ✅ if the input buffer had wrapped text, the above scenario works as expected ✅ scenario works for CMD, PowerShell Core, and WSL
claunia added the pull-request label 2026-01-31 09:33:33 +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#29218