AAClause / BrailleExtender

NVDA add-on that improves braille support
https://andreabc.net/projects/NVDA_addons/BrailleExtender/
GNU General Public License v2.0
16 stars 17 forks source link

BrailleExtender makes NVDA very sluggish in the new Windows Terminal #104

Closed vincent-lg-ma closed 6 months ago

vincent-lg-ma commented 3 years ago

Windows Terminal

The new Windows Terminal is a pretty good alternative for users of CLI tools, like most developers. Among many features, it has a perfectly accessible tab feature (which is worth something) and offer the ability to scroll back using the keyboard (one more cool feature).

BrailleExtender

Unfortunately, BrailleExtender makes it slow down. I'm not exactly sure why, I've tried to turn options off but without effect. One thing is for sure: if I disable the addon and restart NVDA, then the Windows terminal is definitely faster.

Steps to reproduce

How to reproduce? The lag I experience might, after all, not be easy to reproduce on every machine. So here's a very simple test and something that never fails to provoke a noticeable lag:

  1. Open Windows terminal (you can install it through the Microsoft store, or on the Github page if you prefer).
  2. Once in the Window, type something to produce some amount of text. My personal favorite is to move in a Git repository and enter git log. Glorious.
  3. Use the numpad keys to browse the content in review mode. If you go line by line, you might not notice a lag (it might take a bit longer for every line to display but it's hard to tell for humans such as we are). However, if you go to a long line and press down numpad3 (the right key to move the cursor) and keep the key down for a few seconds, you might notice the cursor moving at a very leisurely pace across the line (personally it moves about 3 characters per second). If you release the key after these seconds you will notice the cursor still going forward at the same speed and potentially for some time.

What is the cause of this lag? I couldn't tell. I definitely don't experience it in cmd.exe. I tend to shy away from ps.exe partly because I find every command to be so sluggish, so perhaps it's the same problem. However, the new terminal is supposed to be fast (and without BrailleExtender the response time seems to be almost as high as in a lightweigh cmd.exe window).

This is sad, because I haven't found a solution beyond just turning the addon off, but I really appreciate BrailleExtender since I primarly use Braille to navigate around. A quick workaround would be appreciated, waiting for a fix which might be a bit difficult to get. That is, if you think of any option I can turn off in BrailleExtender settings to solve this, even if I lose some features of BrailleExtender, at least I'll have the others unlike right now.

I'm sorry to add yet another task to this tool. If I can help by providing debugging information or such, please let me know.

Thanks again for this addon!

AAClause commented 3 years ago

Thanks for this report! :)

I think have an idea. Could you try the following please?

Go to Braille Extender settings > "Undefined character representation" Category > "Representation method" option Set this option to "Use braille table behavior (no description possible)" Save and retry.

Is it better like this?

vincent-lg-ma commented 3 years ago

Hi, thank you for your prompt reply. I have tried without success, the lag still persists. The next option in the same tab seemed to warn of a potential lag if it were checked (and I unchecked it) but no noticeable difference. It might be hard to find what causes the error, since on my personal laptop (which is probably more powerful) I don't see this lag to begin with, so knowing where it comes from is complicated.

vincent-lg commented 3 years ago

I was able to "fix" the issue by turning Attributa off. Shame, that's probably the part of Braille extender I'm most grateful for. So I've compromised: I don't need spelling errors to be displayed while in Windows terminal, so I've made a little profile that automatically opens in wt.exe and turns Attributa off. It seems to work, which isn't really a good reason. As far as I can tell, this causes no additional problem in cmd.exe, so I'm unsure why it happens in wt.exe. This might be worth looking into. If this helps in any way, the only setting I have turned on in Attributa is to watch out for spelling errors and display them (I find it so great when typing emails or documentation).

Hope that helps,

AAClause commented 3 years ago

@vincent-lg Thanks for putting me on the trail! I'll investigate ASAP. Are you using the stable or development version?

vincent-lg commented 3 years ago

The stable version. I haven't tried running on the development version instead, though I can test!

vincent-lg commented 1 year ago

I seemed to have found a fix for that issue. Somehow, it came back, hard, a few days ago. I comment on this issue since it's probably the same bug.

Basically, NVDA loses a lot of steam in the Terminal console. The problem becomes extremely irritating when the output window grows a bit (running a few unit tests that fail is quite enough). And when I turn the addon off, NVDA becomes extremely happy and fast again.

A new behavior is that when the output window grows a bit, pressing pavnum7 to go to the previous line will work... for half a second. Then, review goes back to the last line (the prompt) even if it hasn't changed a bit. This happens even with NVDA (no addon) but usually stops after a second or so (and sometimes even less). With BrailleExtender though, this behavior is prone to last 10 seconds (switching windows and coming back to the terminal seems the only fix).

Since I use the Windows command line for developing, this is not exactly fun. I browsed through the BrailleExtender settings to see if I could deactivate something. Pretty sure there was a setting I could have toggled... but I couldn't find it this time. And I'm not sure what's responsible for the behavior.

In the "document formatting" tab, I checked the "plain text" checkbox to see if it would make NVDA faster in the terminal (it's not like I need to see spelling errors in the command line). But it had a very limited effect in terms of performance. So obviously, that's not the greatest cause for harm. Perhaps it's the filter on unidentified Braille character. In any case, I tried to set up a profile just for the terminal with as many settings disabled as I could. But it disabled settings in every profile, so that wasn't the best strategy.

I'm not sure what I could do to solve (or even investigate) the issue. Any suggestion would be most welcome!

Again, thanks for this addon.

vincent-lg commented 6 months ago

Apologies. This had nothing to do with BrailleExtender. The culprit was (and still is) ReviewCursorCopier. I've to look into that addon. Anyway, BrailleExtender causes no lag, whether in the terminal or elsewhere, that I could notice. You may close this. Thanks again!

AAClause commented 6 months ago

No problem, thanks for this feedback! :)