Using readline-8.3 (with bash-5.3_p3 or bash-5.2_p37) there seems to be a 
history-search-backward regression inserting stray partial lines into the 
history.
It does not occur with readline-8.2_p13 (with bash-5.2_p37). Other functions 
(like history-search-forward) might also trigger this.

Using history-search-backward (PgUp) on a partial line will commit that partial 
line to the .bash_history file.

Example:
On a system with readline-8.3, e.g. Debian Sid (tested on 
debian-sid-genericcloud-amd64-daily-20251120-2302)

Start with a .bash_history containing only
echo hello
echo world
And /etc/inputrc containing (at least)
"\e[5~": history-search-backward

Open a shell
Up Up Enter
-> echo hello
Up Esc-Left Ctrl-K "w" PgUp Enter
(or) Up Esc-BkSp "w" PgUp Enter
-> echo world
Exit (Ctrl-D)
But now there is a truncated "echo w" entry in .bash_history (possibly 
replacing "echo hello“, I guess)

$ cat .bash_history
echo hello
echo world
echo w
echo world

I found the latest 8.2 (readline-8.2_p13) to be unaffected
and all of 8.3 affected, tested were

- https://ftp.gnu.org/pub/gnu/readline/readline-8.3-alpha.tar.gz
- https://ftp.gnu.org/pub/gnu/readline/readline-8.3-rc2.tar.gz
- https://ftp.gnu.org/pub/gnu/readline/readline-8.3.tar.gz
- http://git.savannah.gnu.org/cgit/readline.git/snapshot/readline-master.tar.gz 
(8.3_p1)
- http://git.savannah.gnu.org/cgit/readline.git/snapshot/readline-devel.tar.gz

I also did a partial install by placing just libreadline.so.8.3 in a 8.2 
install, which reproduces the bug.

How can I investigate this further? Are there incremental change sets between 
8.2 and 8.3 to bisect?

Thanks,
Christian

Reply via email to