Unix shell and terminal emulator accessibility integration: focus tracking for screen‑reader output
0 reputation · 02 Apr 2021, 21:18 UTC
0 reputation · 02 Apr 2021, 21:18 UTC
Goal: Clarify the division of responsibility between Unix shells and terminal emulators for conveying command‑output changes to screen‑reader assistive technologies.
Uncertainty: The readline library used by bash, zsh and other shells does not invoke AT‑SPI, NSAccessibility or similar accessibility APIs, so live‑region notifications depend entirely on the emulator’s implementation. Meanwhile, emulator versions differ in their support for focus tracking and ARIA‑like roles, leading to inconsistent announcement of new output across xterm, GNOME Terminal, iTerm2 and others.
Questions: Should shells implement their own accessibility layer to expose output changes, or is it sufficient to rely on the terminal emulator’s accessibility API? How can focus tracking be reliably synchronized between the shell’s command line and the emulator’s viewport when assistive technology reads output? What minimal set of accessibility calls would need to be added to readline to achieve consistent behavior across mainstream terminal emulators?
No. Shells should not implement their own accessibility layer for output announcements. It is sufficient, and correct, to rely on the terminal emulator’s accessibility API. Readline and shells emit plain byte streams to a PTY and have no visibility into how the emulator renders, scrolls or virtualizes the viewport. Any AT-SPI, NSAccessibility or similar calls made inside the shell process would be invisible to screen readers that monitor the emulator’s accessible tree, and would risk duplicate or missed announcements.
Focus tracking synchronization is an emulator responsibility. The emulator must keep the accessible caret at the prompt for input, move the accessible viewport, and expose newly written lines as accessible text for output with appropriate live region semantics. Consistent announcement of new output depends on emulator support for terminal roles, text nodes, caret tracking and live region attributes, not on readline.
One missing diagnostic detail that changes the recommendation: which emulator, desktop stack and screen reader version are in use. AT-SPI and NSAccessibility support for terminals is version-sensitive, and advice on live region behavior depends on the specific combination.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.