bug-bash
[Top][All Lists]
Advanced

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

Re: ctrl-w oddity on bash-4.4


From: Chet Ramey
Subject: Re: ctrl-w oddity on bash-4.4
Date: Wed, 25 Oct 2017 10:45:11 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

On 10/25/17 10:37 AM, Aron Griffis wrote:
> 
> 
> On Wed, Oct 25, 2017 at 9:48 AM, Chet Ramey <address@hidden
> <mailto:address@hidden>> wrote:
> 
>     On 10/22/17 6:52 PM, Aron Griffis wrote:
>     > I'm seeing some strange behavior and don't know if it's a bug or 
> intended.
>     >
>     > Reproducer:
>     > 1. env INPUTRC=/dev/null bash --norc
>     > 2. set -o vi
>     > 3. true --foo=bar
>     > 4. up arrow, then left arrow to put the cursor on the equals sign
>     > 5. press ctrl-w, nothing happens
> 
>     Posix says the word boundaries for ^W in insert mode are characters that
>     aren't <blank> or <punct>. So you deal with the character before the
>     cursor (`o'), and delete to a character that isn't <blank> or <punct>.
>     Since the `o' is in neither character class, it's the word boundary, and
>     you don't delete anything. FWIW, ksh93 behaves the same way (but beeps
>     annoyingly).
> 
> 
> Thanks Chet. Seems hard to imagine this is what a user would expect, but
> who am I to argue with POSIX? :-)

If you read the discussion in the thread I pointed to last night, `real'
vi supposedly does this kind of thing. I'm not enough of a vi user to
say one way or the other.

> 
> For myself, the behavior I want is provided by the combination of
> bind-tty-special-chars and unix-word-rubout:

Yes, that's the way to get the previous behavior.  There's a little bit
more of an explanation in the posting you referenced.

Chet
-- 
``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/



reply via email to

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