fish_key_reader: Humanize key descriptions

This used to print all codepoints outside of the ASCII range (i.e.
above 0x80) in \uXXXX or \UYYYYYYYY notation.

That's quite awkward, considering that this is about keys that are
being pressed, and many keyboards have actual symbols for these on
them - I have an "ö" key, so I would like to use `bind ö` and not
`bind \u00F6`. So we go by iswgraph.

On a slightly different note, `\e` was written as `\c[ (or \e)`. I do
not believe anyone really uses `\c[` (the `[` would need to
be escaped!), and it's confusing and unnecessary to even mention that.
This commit is contained in:
Fabian Boehm
2023-08-26 09:40:53 +02:00
parent d803ebbff9
commit 55c425a0dd
3 changed files with 8 additions and 3 deletions

View File

@@ -56,7 +56,7 @@ Example
> fish_key_reader --verbose
Press a key:
# press alt+enter
hex: 1B char: \c[ (or \e)
hex: 1B char: \e
( 0.027 ms) hex: D char: \cM (or \r)
bind \e\r 'do something'