[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem after removing keybinding for bind -m vi-insert '"jj": "\e\e
Re: Problem after removing keybinding for bind -m vi-insert '"jj": "\e\e"'
Fri, 24 Nov 2017 10:37:08 -0500
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
On 11/20/17 11:25 PM, Clark Wang wrote:
> [STEP 100] # echo $BASH_VERSION
> [STEP 101] # bind -m vi-insert '"jj": "\e\e"'
> [STEP 102] # bind -X
> "jj": "\e\e"
> [STEP 103] # bind -r jj
> [STEP 104] # bind -X
> [STEP 105] # <-- Here when I press j it still waits for about 1 second
> to show up.
Here's what happens: when you bind "jj", it creates a new keymap to handle
the longer key sequence, and notes that `j' is now ambiguous: it's either
`jj' or `j' when followed by any other character. That's the reason for the
Removing the binding leaves the new keymap in place, because readline
doesn't check whether removing that binding results in an empty keymap,
which would remove the ambiguity.
Readline doesn't have the internal machinery in place to check for and
remove empty keymaps when removing a key binding. I'll have to look at
what it will take to add.
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://cnswww.cns.cwru.edu/~chet/