Bug 1477328

Summary: Ctrl-W (erase word) in vi editing-mode has wrong behavior
Product: [Fedora] Fedora Reporter: John Florian <trailtotale>
Component: readlineAssignee: Jaromír Cápík <jaromir.capik>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: c.david86, jan.kratochvil, jaromir.capik, jchaloup, svashisht
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-02 15:43:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Florian 2017-08-01 19:40:59 UTC
Description of problem:
Ctrl-w now stops at word-breaking characters rather than spaces as it's done for a very long time.

Version-Release number of selected component (if applicable):
d13677@mdct-dev12

How reproducible:
always

Steps to Reproduce:
1. set -o vi
2. ls /etc/hosts.allow^w


Actual results:
Only "allow" is erased in F26.

Expected results:
With F25 and prior the entire path would be erased.


Additional info:
- Only vi mode seems affected.
- I can bind vi-unix-word-rubout to keys other than ctrl-w and get the expected behavior but I can't seem to even kludge ctrl-w into the old behavior, including tricks like "stty werase 00".
- "bind -p" shows the correct mapping.

Comment 1 John Florian 2017-08-01 19:49:07 UTC
Meh, version above was bad copy/paste.  Here we go:

readline-7.0-5.fc26.x86_64

Comment 2 John Florian 2017-08-02 15:43:56 UTC
Turns out this not a bug but rather a change in defaults.  For others who find themselves in a similar situation:

CHANGES mentions:
m.  The default binding for ^W in vi mode now uses word boundaries specified
    by Posix (vi-unix-word-rubout is bindable command name).

The change I needed in ~/.inputrc to restore prior behavior was:

# This is necessary since ^W is the default stty werase character as readline
# will bind it to its vi-mode equivalent when that variable is enabled.
set bind-tty-special-chars off

# Bind to the old rubout feature rather than the new vi-unix-word-rubout feature.
+control-w: unix-word-rubout