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: Aron Griffis
Subject: Re: ctrl-w oddity on bash-4.4
Date: Wed, 25 Oct 2017 10:37:59 -0400

On Wed, Oct 25, 2017 at 9:48 AM, Chet Ramey <chet.ramey@case.edu> 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? :-)

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

set editing-mode vi
# Disabling bind-tty-special-chars allows unix-word-rubout to work:
# http://lists.gnu.org/archive/html/help-bash/2016-11/msg00004.html
set bind-tty-special-chars off
set keymap vi-insert
control-w: unix-word-rubout

Thanks,
Aron


reply via email to

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