help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] vim mode changes


From: Bob Proulx
Subject: Re: [Help-bash] vim mode changes
Date: Fri, 11 Aug 2017 12:47:57 -0600
User-agent: NeoMutt/20170609 (1.8.3)

Chadwick Rogers wrote:
> Greg Wooledge wrote:
> > Chadwick Rogers wrote:
> > > But my scenario is slightly different.  Run bash in vi-mode,
> > > type "echo hello world", press enter, press up arrow on your
> > > keyboard, press the home key to jump to the beginning of the
> > > line followed by the right arrow to the end of 'hello' or press
> > > the left arrow to the end of 'hello', press ctrl+w, the word
> > > will not delete.
> >
> > Those just are not vi editing commands or paradigms.  Those are emacs
> > editing paradigms.

They aren't Emacs editing paradigms.  Control-W is a tty driver
editing character.  Nothing emacs about it at all.  (In Emacs C-w
actually does something different.)

  $ stty -a | grep werase
  werase = ^W; ...

Dates back to the beginning of time before command line editing using
either emacs or vi modes existed.

> > You haven't even hit Esc at any point to switch to command mode,
> > let alone used a vi command like "dw" to delete a word.

The up arrow is the ESC k here.  There is an escape in the up arrow
terminal sequence (ESC O A on my terminal).  After hitting up arrow
you are in command mode.

> Thanks for the reply.  Perhaps my description is wrong.  The behaviour I
> describe only happens when inputrc has in editing-mode vi, and the
> behaviour seems to have changed in a recent version.

Your description was okay.  I confirm that something has changed in
recent versions of bash.

On my Debian system with bash 4.3.30 this works as you want.  The ^W
character anywhere on the line will erase the previous word.  In more
recent bash 4.4.12 it now behaves differently as you are describing
and only deletes the previous word if at the end of the line.
Definitely a behavior change between the bash versions.

Bob



reply via email to

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