ScreenInfoUiaProvider::GetSelection() returns an improper result #6262

Closed
opened 2026-01-31 00:33:39 +00:00 by claunia · 2 comments
Owner

Originally created by @carlos-zamora on GitHub (Feb 3, 2020).

Originally assigned to: @carlos-zamora on GitHub.

Summary

Our TermControlUiaProvider (aka ScreenInfoUiaProvider) returns a list of UiaTextRange for our selection (one per row in the buffer).

The docs for GetSelection state we should only return one range.

Technical Details

For SupportedTextSelection, we state that we only support a single selection.

The documentation for GetSelection states as follows:

For UI Automation providers that support text selection, the provider should implement this method and also return a ITextProvider::SupportedTextSelection value.

If the control contains only a single span of selected text, the pRetVal array should contain a single text range.

If the control contains a text insertion point but no text is selected, the pRetVal array should contain a degenerate (empty) text range at the position of the text insertion point.

Originally created by @carlos-zamora on GitHub (Feb 3, 2020). Originally assigned to: @carlos-zamora on GitHub. # Summary Our TermControlUiaProvider (aka ScreenInfoUiaProvider) returns a list of UiaTextRange for our selection (one per row in the buffer). The docs for `GetSelection` state we should only return one range. # Technical Details For [SupportedTextSelection](https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-supportedtextselection), we state that we only support a single selection. The documentation for [GetSelection](https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider-getselection) states as follows: >For UI Automation providers that support text selection, the provider should implement this method and also return a ITextProvider::SupportedTextSelection value. > >If the control contains only a single span of selected text, the pRetVal array should contain a single text range. > >If the control contains a text insertion point but no text is selected, the pRetVal array should contain a degenerate (empty) text range at the position of the text insertion point.
Author
Owner

@carlos-zamora commented on GitHub (Feb 3, 2020):

This impacts signaling for selection (#2447).

If a selection is created, we return the wrong range.

@carlos-zamora commented on GitHub (Feb 3, 2020): This impacts signaling for selection (#2447). If a selection is created, we return the wrong range.
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 6, 2020):

-triage since this is in PR and we chatted about it offline

@DHowett-MSFT commented on GitHub (Feb 6, 2020): -triage since this is in PR and we chatted about it offline
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6262