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

When NVDA is started from source with python.exe it is not possible to interact with any console window. #8653

Closed
lukaszgo1 opened this issue Aug 20, 2018 · 7 comments · Fixed by #10964
Milestone

Comments

@lukaszgo1
Copy link
Contributor

lukaszgo1 commented Aug 20, 2018

Steps to reproduce:

  1. On system with all NVDA dependencies installed clone NVDA git repository and run scons source.
  2. move to the source directory and type python nvda.pyw
  3. Try to read a console window in which NVDA is started.
  4. Open another cmd and try to interact with it.

Actual behavior:

Screen reviev keys didn't work and the following is written in the log each time when the console is focused.

ERROR - NVDAObjects.behaviors.LiveText._monitor (14:54:56.263):
Error getting initial lines
Traceback (most recent call last):
  File "NVDAObjects\behaviors.py", line 260, in _monitor
    oldLines = self._getTextLines()
  File "NVDAObjects\window\winConsole.py", line 49, in _getTextLines
    return winConsoleHandler.getConsoleVisibleLines()
  File "winConsoleHandler.py", line 121, in getConsoleVisibleLines
    consoleScreenBufferInfo=wincon.GetConsoleScreenBufferInfo(consoleOutputHandle)
  File "wincon.py", line 70, in GetConsoleScreenBufferInfo
    raise WinError()
WindowsError: [Error 6] Nieprawidłowe dojście. which in polish mean something like the handle is invalid.

Expected behavior:

NVDA should be able to read a console window.

System configuration:

NVDA Installed/portable/running from source:

Running from source

NVDA version:

master commit ec3eeee (HEAD -> master, nvaccess/master

Windows version:

Windows 7 x64

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

Python 2.7.15, Visual Studio community 2017

Other information about your system:

None

Other questions:

Does the issue still occur after restarting your PC?

Yes

Have you tried any other versions of NVDA?

No

@LeonarddeR
Copy link
Collaborator

You are expected to start nvda with pythonw, not with python. Does the problem persist if you do this?

@lukaszgo1
Copy link
Contributor Author

When starting NVDA with pythonw console windows can be read. I am aware of the fact that starting with pythonw is a recomended way, however as mentioned in the readme in rare occasion using python.exe to start might be useful.

@codeofdusk
Copy link
Contributor

Fixed in #9771.

@CyrilleB79
Copy link
Collaborator

Tested with pythonw or pyw -3-32. All is working correctly.

With python or py -3-32 on windows 10 1709, @codeofdusk wrote in #10352 (duplicate of this one):

On 1709, you can get some limited console support when running from source by changing "Windows Console support" to "prefer UIA" in advanced preferences. Caret movement and review by granularity other than line has limited to no support

Tested and confirmed to work on my side.

@Adriani90
Copy link
Collaborator

@lukaszgo1 if this issue is not reproducible for you in last NVDA Alpha, I think we can Close this issue as works for me.

@JulienCochuyt
Copy link
Collaborator

@lukaszgo1: Any update? Is UIA support of the Windows Console a satisfying solution for you?

@codeofdusk
Copy link
Contributor

Well, now make that fixed in #10964 (#9771 was reverted).

@LeonarddeR LeonarddeR changed the title WHen NVDA is started from source with python.exe it is not possible to interact with any console window. When NVDA is started from source with python.exe it is not possible to interact with any console window. Jul 2, 2020
seanbudd pushed a commit that referenced this issue Jun 21, 2022
…(Windows 11 Sun Valley 2) (#10964)

Supersedes #9771 and #10716. Closes #1682. Closes #8653. Closes #9867. Closes #11172. Closes #11554.

Summary of the issue:

Microsoft has significantly improved performance and reliability of UIA console:
* microsoft/terminal#4018 is an almost complete rewrite of the UIA code which makes the console's UIA implementation more closely align with the API specification.
* microsoft/terminal#10886, microsoft/terminal#10925, and microsoft/terminal#11253 form a robust testing methodology for the UIA implementation, including bug fixes in response to newly added tests based on Word's UIA implementation.
* microsoft/terminal#11122 removes the thousands of empty lines at the end of the console buffer, significantly improving performance and stability. Since all console text ranges are now within the text buffer's bounds, it is no longer possible for console to crash due to the manipulation by UIA clients of an out-of-bounds text range.
* Countless other accessibility-related PRs too numerous to list here.

We should enable UIA support on new Windows Console builds by default for performance improvement and controllable password suppression.

Description of how this pull request fixes the issue:

This PR:
* Exposes all three options for the UIA console feature flag in the UI (replaces the UIA check box with a combo box).
* Adds a runtime check to test if `apiLevel >= FORMATTED`, and use UIA in this case when the user preference is auto. This is the case on Windows 11 Sun Valley 2 (SV2) available now in beta and set for release in the second half of 2022.
@nvaccessAuto nvaccessAuto modified the milestone: 2022.3 Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants