Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui Automation in Windows Console: fix _getTextLines for 21H1 #11760

Merged
merged 1 commit into from
Oct 16, 2020

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Oct 14, 2020

Link to issue number:

Supersedes #11722. Fixes #11740 (originally filed upstream as microsoft/terminal#5481). Blocking #10964.

Summary of the issue:

In an old implementation of NVDA's UIA console support, we originally used the standard _getTextLines implementation, which called getTextInChunks to get each line from the console according to UIA. This was extremely slow to run over the entire buffer, so we switched to getting all text and calling splitlines, which was much faster.

In pre-21H1 UIA console, every line ended with a newline character. In 21H1 console, new text can wrap across lines, so every line doesn't necessarily end in a newline. This makes splitlines inadequate for 21H1: when text wraps, NVDA starts reading from the beginning of the visible text for every new line of output!

Description of how this pull request fixes the issue:

This PR:

  • Disables the _getTextLines override on the 21H1 UIA console. Pre-21H1 is entirely unaffected.
  • Clarifies a comment in initialization at POSITION_LAST based on a conversation with @carlos-zamora.

Testing performed:

Re-tested the case in microsoft/terminal#5481 and verified that it is no longer reproducible.

Known issues with pull request:

Change log entry:

None needed.

@AppVeyorBot
Copy link

See test results for failed build of commit 7370b21590

@LeonarddeR LeonarddeR added this to the 2020.4 milestone Oct 14, 2020
@AppVeyorBot

This comment has been minimized.

Copy link
Contributor

@feerrenrut feerrenrut left a comment

Choose a reason for hiding this comment

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

Thanks @codeofdusk

@feerrenrut feerrenrut merged commit 6ceb8ac into nvaccess:master Oct 16, 2020
@codeofdusk codeofdusk deleted the cmduia-fix-21h1-wrap branch October 16, 2020 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UIA in Console: unable to access terminal after scrolling of long text
4 participants