[Top][All Lists]

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

readline 'unix-filename-rubout' whitespace bug

From: dabe
Subject: readline 'unix-filename-rubout' whitespace bug
Date: Thu, 26 Aug 2021 22:14:04 -0400 (EDT)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin18.7.0
Compiler: clang
uname output: Darwin triton.parabon.com 18.7.0 Darwin Kernel Version 18.7.0: 
Tue Jun 22 19:37:08 PDT 2021; root:xnu-4903.278.70~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin18.7.0

Bash Version: 5.1
Patch Level: 8
Release Status: release

        The manpage for bash(1) says:

              Kill the word behind point, ***USING WHITE SPACE AND THE SLASH
              CHARACTER AS THE WORD BOUNDARIES***.  The killed text is saved
              on the kill-ring.   [Emphasis mine]

        In certain circumstances, however, it gobbles up too much.
        [See below...]

        ###  Since we're dealing with ^w...
        ###  'set bind-tty-special-chars off' has the same results
        bash%  stty werase undef

        ###  Now set ^w to 'unix-filename-rubout'
        bash%  bind '"\C-w": unix-filename-rubout'

        ###  Simplest Minimal Reproducible Example:

        Type "echo /" and hit 'ctrl-w'.

        You'd expect it to stop at the space, and just go back to "echo ",
        but instead, it erases both words.  :-(

        ###  Here's a slightly longer example that shows more detail:
        bash%  echo /path/one /path/two   # Now ^w a few times:
               echo /path/one /path/      # OK
               echo /path/one /           # OK
               echo /path/                # FAIL!

PS: I'm hopeful there might be some kind of workaround that will work even
on those dated releases!  [crossing fingers]


:- Dabe

reply via email to

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