bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] How to make vi-insert mode's ctrl-w work in the 4.3 way?


From: Chet Ramey
Subject: Re: [Help-bash] How to make vi-insert mode's ctrl-w work in the 4.3 way?
Date: Fri, 4 Nov 2016 10:32:17 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/4/16 6:30 AM, Clark Wang wrote:
> For example, if I have inputted the following after the prompt:
> 
> # foo "abc"
> 
> In bash 4.3's vi-insert mode, when I press ctrl-w it'll delete the whole
> "abc" (including quotes). But with 4.4 I have to press ctrl-w for 3 times
> (one for the right " char, one for abc and one for the left " char).

This was changed due to a bug report about readline not being Posix-
conformat with its ^W binding in vi insert mode.  Posix specifies that
word boundaries include whitespace and punctuation.  Apparently vi is
the same, but I'm not enough of a vi user to say.

The old binding (unix-word-rubout) is still there, but to avoid it being
overwritten, you need to set the readline variable `bind-tty-special-chars'
to `off'.  (Since ^W is your default stty werase character, readline will
bind it to its vi-mode equivalent when that variable is enabled.)

You would have noticed the ^W binding being overwritten if you had done
a `bind -m vi-insert -p' after one of your key binding commands, but I
suppose there isn't any real reason to do that.

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]