Comment by jauntywundrkind
11 hours ago
I'm slowly working on this, trying to figure out what works as I add accessibility to TUIs. Having better structured information on screen feels so so so compelling to me.
I wish the terminal-wg was more active. There's a bunch of weird odd OSC's folks have tried to make for enhancing structure of the terminal, for various ways to emit more layout-coupled semantic info. Accessibility APIs are great but in most forms a huge chunk of their capabilities feel pretty disconnected from the actual drawing on the screen, are somewhat a parallel construct to what's on screen. Using OSC to layer in more information about what is being drawn feels righter.
Two examples, collapsible regions, semantic prompt regions, https://gitlab.freedesktop.org/terminal-wg/specifications/-/... https://gitlab.freedesktop.org/terminal-wg/specifications/-/...
But in general feels like, for all the TUI interest, not many folks are about and working together to actually figure out how to advance the terminal itself.
I am not sure it is helpful to shoehorn terminals into being a second web. The terminal's strength is its simplicity.
For example, I really dislike mouse support in TUIs. 100% of the times I used the mouse on a TUI, I wanted to copy a piece of text. If the TUI hijacks the mouse and does something different with it (e.g. vim switching into visual mode) that is just annoying.
Of course a11y is important. But it barely works on the web and we won't get perfect semantics on the terminal without a lot of work. I say the better option is to strip down the experience to the parts that work well.
I agree that accidental mouse actions in a TTY are horrible, but generally speaking if you hold shift when clicking and dragging, it will work at the terminal emulater layer instead of sending the clicks to the program in the terminal. I have been shift-clicking like this for years. More because I'm generally in tmux than anything else. If I click and drag without shift I think tmux intercepts it usually.
> If the TUI hijacks the mouse and does something different with it (e.g. vim switching into visual mode) that is just annoying.
tmux is great for this. Just press Ctrl+[ and the cursor can select whatever text is in the window.
If you want to improve TUI accessibility, there is really one magic trick that gets you almost all the way there: https://blind.guru/blog/2021-06-25-brick.html
TL;DR: Use the terminal cursor to indicate focus. Hide it if it bothered you, but place it where the action is. Never use something like just background color to emulate a cursor. Use the real thing.