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: make default in FORMATTED consoles (Windows 11 Sun Valley 2) #10964

Merged
merged 3 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions source/UIAHandler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,7 @@ def _shouldUseUIAConsole(hwnd: int) -> bool:
else:
# #7497: the UIA implementation in old conhost is incomplete, therefore we
# should ignore it.
# When the UIA implementation is improved, the below line will be replaced
# with a check that _getConhostAPILevel >= FORMATTED.
return False
return _getConhostAPILevel(hwnd) >= WinConsoleAPILevel.FORMATTED
codeofdusk marked this conversation as resolved.
Show resolved Hide resolved


@lru_cache(maxsize=10)
Expand Down
5 changes: 1 addition & 4 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2688,10 +2688,7 @@ def __init__(self, parent):
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA determine its Windows Console implementation
# automatically.
# This option is currently equivalent to "legacy", but in a future
# version of NVDA, UIA will be used in known good implementations
# when this option is selected.
_("Automatic (legacy)"),
_("Automatic (prefer UIA)"),
# Translators: A choice in a combo box in the advanced settings
# panel to have NVDA use UIA in the Windows Console when available.
_("UIA when available"),
Expand Down
13 changes: 13 additions & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ What's New in NVDA
= 2022.3 =

== New Features ==
- In the Windows Console Host used by Command Prompt, PowerShell, and the Windows Subsystem for Linux on Windows 11 version 22H2 (Sun Valley 2) and later:
- Vastly improved performance and stability. (#10964)
- When pressing ``ctrl+f`` to find text, the review cursor position is updated to follow the found term. (#11172)
- Reporting of typed text that does not appear onscreen (such as passwords) is disabled by default.
It can be re-enabled in NVDA's advanced settings panel. (#11554)
- Text that has scrolled offscreen can be reviewed without scrolling the console window. (#12669)
- More detailed text formatting information is available. (microsoft/terminal#10336)
-
-


== Changes ==
Expand All @@ -19,6 +28,10 @@ What's New in NVDA


== Changes for Developers ==
- In builds of Windows Console (``conhost.exe``) with an NVDA API level of 2 (``FORMATTED``) or greater, such as those included with Windows 11 version 22H2 (Sun Valley 2), UI Automation is now used by default. (#10964)
- This can be overridden by changing the "Windows Console support" setting in NVDA's advanced settings panel.
-
-


=== Deprecations ===
Expand Down
14 changes: 7 additions & 7 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1052,10 +1052,11 @@ When in the table view of added books:
NVDA provides support for the Windows command console used by Command Prompt, PowerShell, and the Windows Subsystem for Linux.
The console window is of fixed size, typically much smaller than the buffer that holds the output.
As new text is written, the content scroll upwards and previous text is no longer visible.
Text that is not visibly displayed in the window is not accessible with NVDA's text review commands.
On Windows versions before Windows 11 22H2, text in the console that is not visibly displayed in the window is not accessible with NVDA's text review commands.
Therefore, it is necessary to scroll the console window to read earlier text.
In newer versions of the console and in Windows Terminal, it is possible to review the entire text buffer freely without the need to scroll the window.
%kc:beginInclude
The following built-in Windows Console keyboard shortcuts may be useful when [reviewing text #ReviewingText] with NVDA:
The following built-in Windows Console keyboard shortcuts may be useful when [reviewing text #ReviewingText] with NVDA in older versions of Windows Console:
|| Name | Key | Description |
| Scroll up | control+upArrow | Scrolls the console window up, so earlier text can be read. |
| Scroll down | control+downArrow | Scrolls the console window down, so later text can be read. |
Expand Down Expand Up @@ -1894,11 +1895,10 @@ It does not affect the modern Windows Terminal.
In Windows 10 version 1709, Microsoft [added support for its UI Automation API to the console https://devblogs.microsoft.com/commandline/whats-new-in-windows-console-in-windows-10-fall-creators-update/], bringing vastly improved performance and stability for screen readers that support it.
In situations where UI Automation is unavailable or known to result in an inferior user experience, NVDA's legacy console support is available as a fallback.
The Windows Console support combo box has three options:
- Automatic: This option is currently equivalent to "legacy".
However, with this option selected, NVDA will begin using UI Automation in consoles automatically in a future version once it has become stable and suitable for wider use.
- UIA when available: Uses UI Automation in consoles if available.
This will include Console versions which have incomplete or buggy UI Automation implementations.
Though not yet fully stable, UI Automation may provide a superior user experience in some scenarios, especially in the Windows 11 Sun Valley 2 (22H2) update.
- Automatic: Uses UI Automation in the version of Windows Console included with Windows 11 version 22H2 and later.
This option is recommended and set by default.
- UIA when available: Uses UI Automation in consoles if available, even for versions with incomplete or buggy implementations.
While this limited functionality may be useful (and even sufficient for your usage), use of this option is entirely at your own risk and no support for it will be provided.
- Legacy: UI Automation in the Windows Console will be completely disabled.
The legacy fallback will always be used even in situations where UI Automation would provide a superior user experience.
Therefore, selecting this option is not recommended unless you know what you are doing.
Expand Down