bug-readline
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can we decode CSI u escape sequences?


From: Johannes Altmanninger
Subject: Can we decode CSI u escape sequences?
Date: Mon, 18 Apr 2022 21:35:13 +0200

CSI u escape sequences allow to use modifiers like control/shift/alt with any
key (for example it allows to map Control-2 and Control-Space independently).
Today, users can bind them using ugly sequences ("\033[50;5u").
I think it would be nice if readline could decode these sequences (so we
can say "Control-2").

Here's a description of the protocol:
https://sw.kovidgoyal.net/kitty/keyboard-protocol/

Is something like this within the scope of readline?

I'm considering implementing this in the fish shell (which doesn't use
readline but a similar home-grown system). I haven't actually started, so I
probably don't understand the problem well enough, but I think one potential
UI/compatibility wart is as follows:

If a readline function decodes CSI u escape sequences, it might no longer
trigger bindings that match those sequences.  For example this would happen
with this inputrc. Pressing Control-2 should probably only trigger the
first binding.

        Control-2: "new-style binding for C-2, with transparent decoding"
        "\033[50;5u": "old-style binding for C-2, using raw escape sequence"

but if the first binding doesn't existing, the implementation could still
fall back to the second one.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]