On 1/15/26 1:26 PM, Pertti Väisänen wrote:
I have tried to bind Control-w to kill-word without success.

Control-w: kill-word in ~/.inputrc doesn't work.

And neither does bind '"\C-w": kill-word' on the command line.

Check the value of the readline variable `bind-tty-special-chars'. If it's
on, and it's on by default, readline binds the stty special characters to
their readline equivalents each time it's called. These special characters
include the werase character, commonly set to ^W.

This happens on every call to readline() so changes you make with stty are
reflected in the readline key bindings.

Is the command 'unix-word-rubout' in some sense special?

In the sense that it implements the tty driver's werase behavior.

You can either disable the werase stty character:

stty werase undef

or unset the readline variable:

set bind-tty-special-chars off  # inputrc
or
bind 'set bind-tty-special-chars off' # command line

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    [email protected]    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to