On 7/9/25 4:59 PM, Vincent Lefevre wrote:
On 2025-07-09 14:13:59 -0400, Chet Ramey wrote:
On 7/9/25 12:21 PM, Vincent Lefevre wrote:
On 2025-07-09 11:40:17 -0400, Chet Ramey wrote:
On 7/9/25 10:56 AM, Vincent Lefevre wrote:
A \C-u setting in the .inputrc file such as

     "\C-u": kill-whole-line

is ignored if ^U is the kill character (usual tty settings).

This is controlled by the readline variable `bind-tty-special-chars',
which is enabled by default. It's been that way since bash-3.1, which
was released in 2005.

So, this should be the equivalent of the kill character, i.e.
"erase the current line", which corresponds to kill-whole-line
("Kill all characters on the current line, no matter where
point is"), but this is not what I get.

It isn't, though. The readline equivalent of the stty VKILL character
is `unix-line-discard', which kills characters between point and the
beginning of the line. (That happens to be the default binding for ^U
in both emacs and vi modes).

The intent of the KILL character ("kill" in stty) is to erase the
line, as clearly documented in the stty(1) man page:

        kill CHAR
               CHAR will erase the current line

(otherwise it should have said "erase the characters (backward) up
to the beginning of the line").

There is no difference. Since you're always at the end of the line --
you can't move the cursor around using the system's tty driver -- deleting
the characters between the cursor and the beginning of the line and erasing
the current line are the same thing. The readline interpretation is valid,
and shared by other shells (yash, mksh, etc.).


Moreover, the above documentation is incomplete as it does not say
which has the precedence: the tty settings or the user's inputrc
file. And concerning the actual behavior, giving the precedence to
the tty settings as it does is a poor choice: if the user has some
specific setting in their inputrc file, the goal is to use it[*].

You'd be surprised. The entire reason for introducing that variable
was because people complained that their stty settings weren't honored.


IMHO, when bind-tty-special-chars is On, the tty settings should
just have the precedence over the default bindings.

OK. We're not changing it now.

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

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to