bug-bash
[Top][All Lists]
Advanced

[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


From: Chet Ramey
Subject: Re: Problem after removing keybinding for bind -m vi-insert '"jj": "\e\e"'
Date: Fri, 24 Nov 2017 10:37:08 -0500
User-agent: 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
> 4.4.12(4)-release
> [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
delay.

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.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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