[BRLTTY] Footsteps towards better accessibility in Linux

Aura Kelloniemi kaura.dev at sange.fi
Mon Apr 14 08:45:23 UTC 2025


Hi,

On 2025-04-13 at 14:29 -0400, Nicolas Pitre <nico at fluxnic.net> wrote:
 > On Sun, 13 Apr 2025, Aura Kelloniemi wrote:
 > > It is not, if everybody comes up with their custom solution, but it is, if we
 > > try to define all combinations supported by xterm and other compatible
 > > emulators. We cannot know what combinations are necessary and for whom.

 > And to pick a concrete example, what would a CTRL+SHIFT+f do differently 
 > from an ALT+SHIFT+f?

CTRL+SHIFT+f should send a CSI u sequence: \e[66;5u (if I am correct). But
this should only happen when CSI u escape sequences have been enabled by
sending \e[>4;1m to the terminal.

 > I do understand having several combinations with the arrow keys, 
 > PgUp/PgDn, etc. But what would letters do?

CSI u was proposed by Paul Evans in 2008, and it has since been implemented by
several terminal emulators. Unfortunately it seems that none of the AT-SPI2
capable emulators (based on GNOME's VTE library) supports it, so I did not
find a way to test any of them, like xterm, kitty, wezterm, etc. CSI u stands
for Unicode and it is a mechanism for differentiating between legacy key
codes, like for CTRL+F (6) or TAB (9) from real key presses like SHIFT+CTRL+F
or CTRL+I.

 > So let's agree that 128KB worth of key bindings that's a _lot_ already.

Yes, I don't know how many kilobytes is used by xterm's key mapping tables or
CSI u handling code.

 > > But I still stick to my opinion that it would be better to support these
 > > directly, not through function string definitions, as these are supposed to be
 > > always the same, not something that every user wants to customize.

 > Sure, I can buy that argument. Then could you provide some reference to 
 > a formal definition of what those should be? Because otherwise I still 
 > fail to grasp the scale of the problem.

Formal document, hmm. I'm not sure it exists. You could try `man xterm`, but I
doubt it contains all the information.

Something I found from the internet:

1) Description on how xterm handles modifier keys, with the different
strategies: https://invisible-island.net/xterm/modified-keys.html

2) Paul Evans' proposal on handling key presses. This has been adopted (to some
extent) by many terminal emulators: http://www.leonerd.org.uk/hacks/fixterms/

3) Description on how the kitty terminal emulator handles keys. This is the
most advanced method, and many people have praised it. WezTerm supports this
too, and I hope many others will:
https://sw.kovidgoyal.net/kitty/keyboard-protocol/

tmux supports CSI u and many other xterm extended keys, but it does not
document its approach very well.

Now, if this sounds too complex to implement, I totally understand. This is
complex and not too well documented either. The problem is made even worse by
ncurses (and thus terminfo) not supporting anything about the advanced key
handling.

There is probably some documentation on the internet that I just could not
find with a quick search.

Personally I just happen to like modifier keys, and thus I'd like to switch to
a terminal emulator that supports them.

-- 
Aura


More information about the BRLTTY mailing list