Package: bash
Version: 4.3-2
Usertags: serious

History search is broken if horizontal-scroll-mode is enabled in inputrc.

I've attached a small script that simulates the following sequence:

echo foo
<Ctrl+R>foo<End>

With bash (<< 4.3), the result of running this script was:

jwilk@borsuk:~$ bash -i < test-search-hist
stdin: is not a tty
jwilk@borsuk:~$ echo foo
foo
jwilk@borsuk:~$ echo foo
foo
jwilk@borsuk:~$ exit


But with bash (>= 4.3), the second "echo foo" disappears when you press End (or any arrow key):

jwilk@borsuk:~$ bash -i < test-search-hist
stdin: is not a tty
jwilk@borsuk:~$ echo foo
foo
jwilk@borsuk:~$
foo
jwilk@borsuk:~$ exit


I've been able to reproduce this bug only if all of these conditions are met:
- horizontal-scroll-mode is enabled in inputrc;
- TERM=linux;
- a UTF-8 locale is set (e.g. LC_ALL=C.UTF-8);
- PS1 is not very long.


-- System Information:
Debian Release: jessie/sid
   APT prefers unstable
   APT policy: (990, 'unstable'), (500, 'experimental')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.12-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files   7.2
ii  dash         0.5.7-4
ii  debianutils  4.4
ii  libc6        2.18-4
ii  libtinfo5    5.9+20140118-1

--
Jakub Wilk

Attachment: test-search-hist
Description: Binary data

Reply via email to