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

UIA in Windows consoles: spaces are stripped from end of line, blank reported when arrowing through them #10036

Closed
LeonarddeR opened this issue Aug 5, 2019 · 3 comments · Fixed by #10562

Comments

@LeonarddeR
Copy link
Collaborator

cc @codeofdusk

Steps to reproduce:

With UIA enabled in Windows consoles, type multiple spaces and arrow back.

Actual behavior:

NVDA reports blank for every press of left arrow

Expected behavior:

NVDA reports space for every press of left arrow

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

Alpha alpha-18290

Windows version:

Windows 10 1903 build 18362.239

Name and version of other software in use when reproducing the issue:

Windows command prompt (cmd)

Other questions

Does the issue still occur after restarting your PC?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

@AAClause
Copy link
Contributor

Any news on this?

@michaelDCurran
Copy link
Member

Please note that Windows consoles do not store space characters at all. If space is typed and or programmatically written, the character cell at that position is just left blank.
We should possibly return a space character for UIA text ranges that are blank in TextInfo.text. This at least will say 'space' for spaces in the middle of a line like it used to. However, spaces at the end of a line will be impossible as the UIA text ranges for a line don't cover the full terminal width, rather they only go up to the last non-space character on the line.
If the in-line space issue was fixed, would you consider allowing this issue to be closed as fixed, even though spaces at the end of the line (which again don't really exist anyway) was not fixed?

@codeofdusk
Copy link
Contributor

Please note that Windows consoles do not store space characters at all. If space is typed and or programmatically written, the character cell at that position is just left blank.
We should possibly return a space character for UIA text ranges that are blank in TextInfo.text. This at least will say 'space' for spaces in the middle of a line like it used to. However, spaces at the end of a line will be impossible as the UIA text ranges for a line don't cover the full terminal width, rather they only go up to the last non-space character on the line.
If the in-line space issue was fixed, would you consider allowing this issue to be closed as fixed, even though spaces at the end of the line (which again don't really exist anyway) was not fixed?

I'd be happy with this solution – it also seems to have the added bonus of more accurately reflecting the console's contents.

@nvaccessAuto nvaccessAuto added this to the 2019.3 milestone Dec 3, 2019
codeofdusk added a commit to codeofdusk/nvda that referenced this issue May 12, 2021
feerrenrut pushed a commit that referenced this issue May 17, 2021
Fix for microsoft/terminal#9239

Summary of the issue:
Windows 10 21H1 has been released to insiders with significantly reduced scope (i.e. excluding the UIA changes it was originally set to include), making our internal names misleading. Additionally, there are plans to "undock" conhost from Windows, removing the guarantee that a given Windows version will run a particular version of the console (it's technically already possible to run newer console on older Windows, I do it for testing).

Description of how this pull request fixes the issue:
Renames:
- NVDAObjects.UIA.winConsoleUIA.is21H1Plus -> NVDAObjects.UIA.winConsoleUIA.isImprovedTextRangeAvailable
- NVDAObjects.UIA.winConsoleUIA.consoleUIATextInfo -> NVDAObjects.UIA.winConsoleUIA.ConsoleUIATextInfo (Start class name with upper case)
- NVDAObjects.UIA.winConsoleUIA.consoleUIATextInfoPre21H1 -> NVDAObjects.UIA.winConsoleUIA.ConsoleUIATextInfoWorkaroundEndInclusive
  - The implementation works around both end points being inclusive (in text ranges) before microsoft/terminal#4018
  - Workarounds for expand, collapse, compareEndPoints, setEndPoint, etc

Also moves the text override to the workaround textInfo as #10036 is no longer reproducible in new console.
Co-authored-by: Reef Turner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants