-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Integrated terminal does not support screen readers #8339
Comments
Upstream issue: xtermjs/xterm.js#731 |
Targets:
|
@Tyriar I would be happy to help test this. Another thing I've noticed is that the terminal's edit box is read before the actual output. Could this be changed so that the edit box is placed after the output in HTML? That makes it easier to quickly go up to most recent output, instead of scrolling all the way down to find it. #28448 also happens here. |
@Neurrone do you mean it's read when you first focus the terminal? On find, it's probably best to track the solution over in that issue as they are basically the same root cause (the editor and terminal don't use native selection). |
I land on the text entry box when launching the terminal as expected. But the output appears below the input box. This is the reading order when moving about the terminal window manually:
Visually, the order of presentation of the second and third elements are reversed - what you type appears below any recent output. I think this might have to do with the order it was defined in the HTML. |
@Neurrone great feedback 😃 I'm in the process of adding a "navigation mode" which will allow easier navigation of the output. I think this is necessary since only the current viewport is exposed to the accessibility tree, this also answers the your question "is there a way to scroll up". In this new navigation mode you will press some keybinding (still to be determined, any input would be helpful) and the line the current cursor is on will be highlighted. Using up/down will allow you to navigate up and down through the rows. When the boundary is hit it will scroll and tell the screen reader the correct item to read. This works very similar to how the explorer works with the main change of it needing to be toggled on since normally the terminal eats up/down keys. I should be able to put the elements above the textarea without much trouble. |
Support for the screen reader is basically done, here's a summary of the support:
* I'd love to hear suggestions on good keybindings for navigation mode. We will stick this in the docs. We should revisit once we have access to stable AOM in Electron. |
@Tyriar how would the navigation mode work? |
@Neurrone you press the keybinding or enter via the command palette, and it highlights the line with the cursor on it. From here up, down, page up, page down, end and home allow navigating and reading out the rows one by one. Most other keys will exit navigation mode (eg. escape, tab, enter). This works similar to how the explorer works when in this mode. |
@Tyriar is there a convenient way for me to try it? |
@Tyriar just updated and see your changes. I see what you mean now by a navigation mode. Some thoughts after testing:
How would a sighted user review or select and copy terminal output if the command causes > 20 lines of output to be displayed? I understand the reasoning behind the current navigation mode implementation, but some things I'd expect to work such as copying and pasting output won't work properly since each line is a menu item. Thanks a lot for all your work on this, I really appreciate it :) |
Yep, added this to the todo list on the PR.
Unfortunately I'm not sure there's a reliable way to do this. At least until we know on the frontend what the prompt is (which is a difficult problem to solve cross platform) #20676
They're menu items as list items didn't seem to work initially, I can try again though. Added it to the PR.
Will copy and paste just work if they're list items? What role would you expect for these? |
@Tyriar usually expect the output to just be regular text. Maybe on-demand rendering of the full contents of the buffer when entering navigation mode? I believe the default size is 1000 lines. Another suggestion is to increase the number of lines from 20 to e.g, 40 or 50. I can't imagine needing to read past 50 lines of previous output often. How does it handle a mouse user needing to go back? Is there something that can be clicked to scroll up? |
@Tyriar it not echoing the deleted characters is also something relatively minor, mentioned for completeness. |
I just tried list again and the keybindings to navigate don't work using that (under NVDA), tree/treeitem works though. No role doesn't seem to work just like list. Also menu/tree announce position in the output which I think is important information.
This would be pretty bad for perf, also the screen reader and screen would then go out of sync. I'll think about it some more.
Mouse wheel typically, there are also keybindings for scrolling the terminal. Search "terminal scroll" in the command palette to see them. These won't work that well for screen readers though as the rows get reconstructed and the screen reader wouldn't know what's going on (as opposed to navigation mode). |
@Neurrone there was also the idea of a "copy terminal buffer to an editor" command to allow navigation/copy/paste using the editor as a fallback. Would you find such a command useful? |
An alternative to the explicit copy terminal buffer to an editor command is to run the select all terminal command, copy and paste it into an editor. Select all doesn't have a default keybinding on Windows yet though which I could change to ctrl+a. |
Rather than supporting navigation with your own keyboard shortcuts, an idea to consider is just relying on NVDA browse mode.
There are two notable problems with this approach:
|
@jcsteh do you mean @Tyriar since selection wouldn't work using this approach, I was wondering if the use case of selecting previous output was selected for sighted users. If the integrated terminal only allows selecting the current viewport regardless, then this shouldn't be a problem. |
@Tyriar oh, missed your last few comments. Suggest leaving the keystroke unbound by default, since a screen reader user will choose something other than ctrl+a. Think an explicit select all, copy and paste should suffice, unless there are others that will find a copy to empty editor useful as well. |
No, tabindex="-1". 0 would result in every line being in the tab order, which is not what you want. -1 still allows programmatic focus but without putting the element in the tab order.
|
@jcsteh wow, didn't know that NVDA still focuses stuff with |
@jcsteh great ideas! One problem I was seeing when doing this was "focus" was maintained separately in screen readers and standard focus when navigating about a page and therefore not getting events. I guess that might have been because I wasn't using tabindex=-1?
Would home/end/page up/page down still need custom shortcuts? I use page up to scroll a lot when using the terminal personally.
I believe JAWS has issues with Chromium so that's not a target currently.
So the select all command in the command palette with reliably select everything in the terminal as we maintain our own selection model, this was added 6-12 months ago so sighed users can select more than what's in the viewport via keyboard/mouse. As for selecting a subset for screen reader users, we may be adding keyboard selection/selecting to the last command in the future. |
@Neurrone commented on Jan 24, 2018, 11:50 PM GMT+10:
Actually, NVDA can't tell the difference between something with a tabindex >= 0 and -1. All it knows is that it is focusable.
Unless the element is focusable by default (e.g. button, a href, input, etc.), if you're not using a tabindex (-1 or otherwise), it is not focusable as far as the DOM is concerned. Accessibility doesn't get any special treatment here; if it isn't focusable, an accessibility client can't "focus" it either.
The problem is that NVDA browse mode will override these to navigate within browse mode. That is indeed another problem with this approach, perhaps a showstopper.
JAWS does work with Chrome IIRC, but I'm not sure how well it works with embedded Chromium. |
@jcsteh I have a prototype and it's working very well. The only issue I see is that holding down up will skip over the remaining lines. I tried to add a bigger buffer at the top but NVDA just gets confused and continues to focus items above. I think it should be fine to accept that. It also feels more "solid" in general and supports reading through each char in a line etc. On page up/page down/etc. there are other commands that deal with that already, for example shift page up and shift page down scroll up and down a page. I'm thinking I'll just make them aware of the focus inside the terminal and handle it correctly (no need to maintain two different keybindings). |
The next Insiders on Monday will have the new mode.
This didn't work unfortunately as the screen reader takes full control of the keyboard in this mode. |
@Tyriar thanks. About the keyboard override, it shouldn't be too problematic since there's a select all feature. |
Note that users can choose to pass the key through if they wish. If you manage the focus correctly, the screen reader will track it as expected. If you're really concerned about it, you could choose a key binding that isn't occupied by browse mode. For example, although shift+pageUp is taken by the smreen reader to select to the top of the page, alt+pageUp isn't occupied by the screen reader.
|
@jcsteh I thought that would be a possibility, I tried with cmd+page up but it didn't work. Do you know how to do this using NVDA or VoiceOver so I can test it out? |
I'm going to close this off as the feature is done. @jcsteh we can continue the discussion about keys in browse mode in xtermjs/xterm.js#1257 |
It should just work as expected by screen reader users now. Part of microsoft/vscode#8339
#8222
The text was updated successfully, but these errors were encountered: