Skip to content

nvda logs a lot of '\r\n\r\n' if UIA support for Windows console is enabled #14689

Description

@cary-rowen

Steps to reproduce:

  1. In NVDA's Advanced Settings panel, make the following settings:
  • Windows Console support: combo box: UIA when available
  1. Open cmd or git bash and press NVDA+Shift+M(Laptop);

Actual behavior:

There are a lot of '\r\n' in the log.

Expected behavior:

There won't be so many '\r\n' in the log

NVDA logs, crash dumps and other attachments:

log.txt

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

2023.1Beta2

Windows version:

Windows 10 22H2 (AMD64) build 19045.2604

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

None

Other information about your system:

None

Other questions

Does the issue still occur after restarting your computer?

Yes

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

2022.4 is the same

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

Activity

  1. CyrilleB79 commented on Mar 2, 2023

    @CyrilleB79
    Collaborator

    According to your log, the spoken string is 18095 character long. And there are 17994 characters after the last '>', i.e. 8997 '\r\n'.

    @codeofdusk: any idea why so many new lines are captured in the command window when it becomes the foreground?

  2. codeofdusk commented on Mar 2, 2023

    @codeofdusk
    Contributor

    This is a known bug in API level 0 consoles (see microsoft/terminal#6986). In consoles with less than API level 2, no support is provided as indicated in the user guide.

    Mitigation strategies:

    • Ideally, upgrade to Windows 11 Sun Valley 2.
    • If possible, use Windows Terminal (wt.exe), which is continuously updated.
    • If all else fails, upgrade conhost.exe to the version included with Windows Terminal. I've provided guidance in other issues, etc. on how to do that.

    @seanbudd I recommend closing as duplicate of microsoft/terminal#6986.

    CC @carlos-zamora, @DHowett.

  3. cary-rowen commented on Mar 2, 2023

    @cary-rowen
    ContributorAuthor

    @codeofdusk
    If I can't upgrade to windows11 now, can you provide other solutions?

    This problem bothers me because of: ABuffEr/numberProcessing#4

    But due to another issue, not forcing UIA support for Windows Console under Chinese operating systems will cause every Chinese character displayed on the screen to be reported twice by NVDA.

  4. codeofdusk commented on Mar 2, 2023

    @codeofdusk
    Contributor

    If you can't upgrade, either use Windows Terminal (wt.exe) or replace your conhost.

  5. ABuffEr commented on Mar 2, 2023

    @ABuffEr
    Contributor

    Hi,
    just for documentation, the freeze seems to born in speechDictHandler.processText function. Adding something like:

    	try:
    		if config.conf["UIA"]["winConsoleImplementation"] == "UIA":
    			stripText = text.rstrip()
    			if len(text)-len(stripText) > 10000:
    				text = stripText
    	except KeyError:
    		pass
    

    before the dictionaries loop, no freeze happens. But I doubt it would be considered an acceptable solution for a PR...

  6. cary-rowen commented on Mar 3, 2023

    @cary-rowen
    ContributorAuthor

    @codeofdusk
    You wrote:

    If all else fails, upgrade conhost.exe to the version included with Windows Terminal. I've provided guidance in other issues, etc. on how to do that.


    Can you provide a link on how to do this?

  7. codeofdusk commented on Mar 3, 2023

    @codeofdusk
    Contributor

    I've updated my console test package to the latest released build of OpenConsole. Hopefully this can provide a stopgap solution until you upgrade to SV2 or switch to wt.

  8. seanbudd commented on Mar 7, 2023

    @seanbudd
    Member

    @ABuffEr a fix similar to what you suggested is appropriate

  9. added
    p4https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority
    triagedHas been triaged, issue is waiting for implementation.
    app/windows-consoleLegacy console in Windows, potentially will superseded by the app/windows-terminal
    api/uiaFeature or bug requires an understanding of UIA
    on Mar 7, 2023
  10. ABuffEr commented on Mar 7, 2023

    @ABuffEr
    Contributor

    Ok, I'll provide a PR in next hours.

  11. added a commit that references this issue on Apr 5, 2023
    14bc6bd
  12. added this to the 2023.2 milestone on Apr 5, 2023
  13. added a commit that references this issue on Apr 18, 2023
    0731e28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api/uiaFeature or bug requires an understanding of UIAapp/windows-consoleLegacy console in Windows, potentially will superseded by the app/windows-terminalp4https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#prioritytriagedHas been triaged, issue is waiting for implementation.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions