#1078428 libreadline8t64: \C-u kill-whole-line kills only the characters before the cursor instead of the whole line if ^U is the kill character

Package:
libreadline8t64
Source:
libreadline8t64
Description:
GNU readline and history libraries, run-time libraries
Submitter:
Vincent Lefevre
Date:
2025-07-10 22:55:01 UTC
Severity:
normal
#1078428#5
Date:
2024-08-10 09:55:14 UTC
From:
To:
With

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

in the .inputrc file, if ^U is the kill character (usual tty settings),
\C-u kills only the characters before the cursor instead of the whole
line.

This bug was already present in some old libreadline versions:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=363502
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=708978

#1078428#10
Date:
2025-07-09 13:43:48 UTC
From:
To:
Control: retitle -1 libreadline8t64: the \C-u setting in .inputrc is ignored if ^U is the kill character
Control: found -1 8.2-6

The real issue is actually that this

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

setting in the .inputrc file is ignored if ^U is the kill character.
I could check that by changing it to

  "\C-u": backward-word

The setting is honored only after a "stty kill undef" *before* executing
the readline-based command (such as bash or gp).

#1078428#19
Date:
2025-07-10 20:44:51 UTC
From:
To:
As a summary of the discussion at
https://lists.gnu.org/archive/html/bug-readline/2025-07/msg00014.html

More generally, the inputrc settings are ignored for the characters
present in the tty settings. In general, both settings are probably
consistent, but for the kill character, there is an ambiguity: both
kill-whole-line and unix-line-discard match the tty kill behavior, as
in a tty, there cannot be characters after the cursor. Unfortunately,
bash/readline chose unix-line-discard (kill-whole-line is closer to
the actual description, so that this is surprising), and this is not
documented. In any case, whatever the choice done by bash/readline,
I suppose that a part of the users would prefer the other function.

The only clean solution to be able to override this choice (and
other tty settings, if need be) would be that the inputrc settings
should have the precedence over the tty settings. The readline
documentation does not explicitly say which one has the precedence,
but the intent, the logic and the practical usefulness seem to be
that the inputrc settings should have the precedence, which is not
the current behavior.

The only workaround is to set bind-tty-special-chars to Off in the
inputrc settings (e.g. ~/.inputrc file) with

  set bind-tty-special-chars Off

In bash/readline, this was changed to On in the past (2005), because
some people complained that their tty settings were not honored, but
I suppose that under Debian, most users have standard tty settings.
Perhaps there could be some tests by Debian users. So I'm wondering
whether Debian should default this option to On.

#1078428#26
Date:
2025-07-10 22:54:01 UTC
From:
To:
Of course, I meant that it should be set back to Off.

I haven't seen any drawback with both the default tty settings
and my tty settings (basically, with "stty -ixon").