Allow utf-8 safe meta key mapping in inputrc #723
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #603
The inputrc file below will add
"\ec"
to additional key binding but does not add"\xE3"
. This behavior is different from Readline but I believe this is better.Also supports these formats
Problem of Readline
Using this inputrc file,
"\M-c"
is"\xE3"
. Readline only assign"\xE3"
to the right hand side key. Terminal emulator that supports utf-8 does not send"\xE3"
by alt+c because"\xE3"
is part of a valid utf-8 string.When you enter
"あ" == "\xE3\x81\x82"
, Readline thinks the input is"\M-c" + [invalid two bytes]
.If convert-meta is enabled, Readline assigns
"\xE3"
and"\ec"
. Now alt-c works.But now,
"え" == "\xE3\x81\x88" == "\xE3\x81\M-\C-H"
will trigger\M-\C-H = ed-delete-prev-word
.In utf-8 environment, convert-meta is unusably terrible.
IMO Reline should not follow this old specification.
"\M-c": key
should only assign"\ec"
to the key.