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: Disable visible range bounding on 21H1 and later #11495

Closed

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Aug 15, 2020

Link to issue number:

Blocked by microsoft/terminal#6986.

Summary of the issue:

It was mentioned in microsoft/terminal#6453 (comment) that some new console text can actually appear below the visible range, making it completely inaccessible to NVDA.

Description of how this pull request fixes the issue:

No longer bound the console's text info to the visible ranges on 21H1 and later. This will require upstream changes by Microsoft to maintain usability in the console after this PR.

Testing performed:

  • Adjusted winConsoleUIA._getTextLines to limit the number of lines in the diff and tested the case in UIA in conhost: issues with visible ranges microsoft/terminal#5481. Observed that the bug is no longer reproducible.
  • Tested that pre-21H1 UIA consoles still work as expected (word navigation, bounding, going to the ends of the console).

Known issues with pull request:

  • There are thousands upon thousands of blank lines in the output, slowing down the diffing algorithm to the point that the console is unusable. Switching to DMP makes the console usable but with a noticeable brief lag.
  • Moving the review cursor to the bottom of the console crashes it. I'll file an upstream bug.

Change log entry:

Not user visible.

@codeofdusk
Copy link
Contributor Author

Cc @carlos-zamora, @DHowett, @michaelDCurran.

@LeonarddeR
Copy link
Collaborator

Please describe the underlying issue with NVDA along with steps to reproduce. Also, it would help if you could provide info on how Narrator behaves in this case.

@codeofdusk
Copy link
Contributor Author

From microsoft/terminal#5481:

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd] next (19613.1000).
Windows Terminal version (if applicable): Inbox console

Any other software? NVDA

Steps to reproduce

  1. Download this list of domains.

  2. Start Windows Console and NVDA (with UIA in Windows Console enabled in advanced preferences).

  3. Run a python interpreter: python.

  4. Run:

    fin=open("domains.txt")
    fin.readlines()

Expected behaviour

Like in pre-21H1 conhost and Windows Terminal 0.11, NVDA reads current output immediately.

Actual behaviour

At this point, NVDA's auto-read lags far behind the actual output in the buffer. Quitting Python with quit() continues reading very old output.

Context

When a text change event is received, NVDA takes a diff of the old and new text and reads only the changed portion of the text. Maybe there's a bug in our diffing algorithm (implemented here, in LiveText._calculateNewText)?

@codeofdusk
Copy link
Contributor Author

Closing in favour of a solution to #11172.

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.

2 participants