On 10/25/17 10:37 AM, Aron Griffis wrote:
>
>
> On Wed, Oct 25, 2017 at 9:48 AM, Chet Ramey <[email protected]
> <mailto:[email protected]>> 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 [email protected] http://cnswww.cns.cwru.edu/~chet/