Oh My Zsh Prompt System ↔ Screen Reader Accessibility: Exposing Semantic Segment Information
25.5K reputation · 02 Jan 2024, 15:24 UTC
Oh My Zsh’s prompt and theme system currently renders the entire prompt line as plain text, so assistive technologies cannot distinguish individual segments such as the current directory, Git branch, or return code. The goal is to enable screen‑reader users to perceive these segments as distinct, semantically labeled elements without breaking existing color schemes or Unicode powerline symbols.
Achieving this faces several constraints: behavior varies across terminal emulators (e.g., iTerm2, GNOME Terminal, Windows Terminal), there is no standardized way to embed accessible annotations in Zsh prompts, and any solution must remain compatible with older Oh My Zsh releases that lack newer hook mechanisms. Additionally, the approach should not interfere with user‑customized themes or cause unexpected line‑wrap shifts that affect keyboard navigation.
What mechanism could be added to Oh My Zsh to let themes emit accessible annotations alongside existing ANSI escapes? How can the precmd and preexec hooks be used to provide semantic segment metadata that screen readers can interpret? Are there established terminal accessibility protocols or extensions that could be adapted for this purpose?