PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Support mode to not redraw line for screen reader purposes

Open SteveL-MSFT opened this issue 6 years ago • 11 comments

Environment data

PS version: 6.2.0-preview.4 PSReadline version: 2.0.0-beta3 os: 10.0.18836.1002 (WinBuild.160101.0800) PS file version: 6.2.0

Steps to reproduce or exception report

Enable Narrator on Windows. Start typing in PowerShell: dir

Currently, it reads: d, di, dir

Some users who type long command lines prefer not to read the entire line (this is reported by customers). Instead, they prefer it reads: d, i, r.

Narrator (and other screen readers) read what is sent to the console, so one option is to have a mode that doesn't re-render the line. This will have some side effects like not correctly supporting coloring, but this is opt-in for the purpose of screen readers so should be fine.

SteveL-MSFT avatar Feb 20 '19 02:02 SteveL-MSFT

I think there is an issue on this already - but it's about performance.

I'm opposed to a mode that gets coloring wrong. If it's too unreasonable to ensure correct coloring (which probably isn't the case), then this mode should disable coloring completely.

Note that inserts not at the end of the line or any deletions would like result in reading the entire line unless the console exposing some way of hinting what the narrator should read.

lzybkr avatar Feb 20 '19 03:02 lzybkr

Disabling coloring completely in this mode seems fine.

SteveL-MSFT avatar Feb 20 '19 19:02 SteveL-MSFT

Sure, but it doesn't solve the performance problem which is apparently noticeable over slow connections.

If you can kill 2 birds with one stone and avoid creating a new mode - that would be ideal.

lzybkr avatar Feb 20 '19 20:02 lzybkr

And if you do go with a narration mode - it should be automatic, and shouldn't need a user visible option.

lzybkr avatar Feb 20 '19 20:02 lzybkr

I believe some users may want the current narration behavior which tries to read what is typed as a sentence to verify what you typed is correct. But the feedback is that there are a different set of users who don't want that for efficiency reasons and presumably they don't make typos. So I don't see how that can be automatic.

SteveL-MSFT avatar Feb 20 '19 20:02 SteveL-MSFT

Well let me ask the question in a different way. Is there a way for any console application to tweak the narration experience? It seems a little unreasonable for a console application to add narration specific settings - that feels like a system setting.

lzybkr avatar Feb 20 '19 21:02 lzybkr

Last time I looked at this, there wasn't a way for a console app to interact directly with narrator (or the accessibility apis used). I've been informed by the people requesting this capability that Narrator specifically has a setting that enables reading the console per line instead of per character that shows up on the console (the default). Let me follow-up with the console team to see if they have plans to improve accessibility integration with the console.

SteveL-MSFT avatar Feb 20 '19 22:02 SteveL-MSFT

Hello everyone,

I'm a Narrator user and an NVDA developer. Based on a discussion with @@SteveL-MSFT, it appears it could be an issue involving both PSReadLine and screen readers. As of September 2020, I cannot reproduce the output noted above with NVDA at the moment.

My setup:

  • OS: Windows 10 20H2 beta (10.0.19042.487)
  • NVDA version: 2020.2 (stable) and alpha build
  • PowerShell: 7
  • NVDA settings: UIA used to access Windows Console applications.

Procedure:

  1. Start NVDA.
  2. Run PowerShell.
  3. Import PSReadLine.
  4. Press Insert+nubmer row 2 to turn off character echo from NVDA.
  5. Type "dir" (one letter at a time).

Expected: NVDA announces nothing, or if it announces things, it will not say, "d", "di", "dir". Actual: same as above.

I'm thinking it may have to do with events, as whenever characters are entered, PowerShell fires UIA text change event. I'm guessing that Narrator is a bit aggressive when it comes to announcing what is seen on a line - attempting to announce all text if possible. NVDA calculates the diff between current and new text and only announces new text if possible (observed when running a command such as Git from WSL where a text on a single line changes frequently, such as when doing a Git pull).

Thanks. CC @LeonardDeR, @CodeOfDusk

josephsl avatar Sep 02 '20 16:09 josephsl

I'll ask my team to re-validate this with latest NVDA. If it no longer repros, we should disable that check. cc @daxian-dbw

SteveL-MSFT avatar Sep 02 '20 17:09 SteveL-MSFT

I can neither reproduce this behavior with UIA in Windows console enabled or disabled in NVDA. I can still reproduce it in Narrator, though

LeonarddeR avatar Sep 02 '20 17:09 LeonarddeR

Narrator doesn't set the SR flag, so PowerShell doesn't know if it's active. When we get around to this feature, we'll need to talk to that team again.

SteveL-MSFT avatar Sep 02 '20 17:09 SteveL-MSFT