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.
The current way of setting the keyseq as
bind "'\C-r': '...'"
appears to work as expected, but this is accidental. This is not the format that Readline supports; the keyseq cannot be enclosed within single quotes. This is now working because of Readline's loose treatment of the keyseqs, but this will easily be broken with a slightly different key representation.Readline's interpretation of
'\C-r'
is as follows:r'
. This doesn't match any known key names such asESC
,DEL
, etc., so Readline just picks up the first characterr
.C-
andM-
against'\C-r'
. NowC-
matches.However, this doesn't work e.g. with a different representation of C-r:
'\x12'
. This time, the string doesn't contain a hyphen, soReadline considers
'\x12'
is the full key name. It doesn't match any known key name, so Readline extracts the first character'
as the key, which is different from the intention. One can confirm this interpretation by the following commands:In this PR, I suggest using the standard
"
instead of unsupported'
. I modified it by reversing'
and"
. The macro string (i.e., the righ-hand side of:
) can actually be quoted by single quotes, but I also modified it to"
because it is easier for quoting.