Skip to content

Improve screen reader announcements for search box#19726

Merged
carlos-zamora merged 3 commits intomainfrom
dev/cazamor/a11y/search-box
Jan 14, 2026
Merged

Improve screen reader announcements for search box#19726
carlos-zamora merged 3 commits intomainfrom
dev/cazamor/a11y/search-box

Conversation

@carlos-zamora
Copy link
Member

Summary of the Pull Request

Improves the notification read out by a screen reader when a search is done in the terminal. This is done across several scenarios:

  • previously, the results were only read occasionally. Moving the block out of if (results.SearchInvalidated) fixes that.
  • previously, we read "Results found" or "No results found". Now, we read an accessible version of the written status message.

In order to maintain consistency with the written status message, _FormatText() now takes an isAccessible parameter to output a more accessible version of the text. Specifically...

  • CurrentIndexTooHighStatus (aka ?) would not be read, so we replace it with TermControl_UnknownSearchResultIndex (aka unknown)
  • TermControl_TooManySearchResults (aka 999+) would drop the + when read, so we replace it with TermControl_TooManySearchResults (aka over 999)
  • TermControl_NumResults (aka {0}/{1}``) would be read as a fraction, so we replace it with TermControl_NumResultsAccessible(aka{0} of {1}`).

Validation Steps Performed

✅ Announcements are read out when interacting with search box (i.e. next, prev, regex toggle, etc.)
✅ "4 of 5" read out by screen reader (or something similar) when search is performed

Closes #19691

@carlos-zamora
Copy link
Member Author

  • TermControl_NumResults (aka {0}/{1}``) would be read as a fraction, so we replace it with TermControl_NumResultsAccessible(aka{0} of {1}`).

This is the main one I want double checked. Is that okay for localized scenarios?

if (currentMatch < 0 || currentMatch > (MaximumTotalResultsToShowInStatus - 1))
{
currentString = CurrentIndexTooHighStatus;
currentString = isAccessible ? RS_(L"TermControl_UnknownSearchResultIndex") : CurrentIndexTooHighStatus;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option would be to pass the "too high" and "format" strings as string arguments instead.

@carlos-zamora carlos-zamora merged commit b668fd5 into main Jan 14, 2026
20 checks passed
@carlos-zamora carlos-zamora deleted the dev/cazamor/a11y/search-box branch January 14, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows Terminal>Find]: Screen reader does not announce result position while navigating 'Find' suggestions.

2 participants