akinomyoga / ble.sh

Bash Line Editor―a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc. for Bash interactive sessions.
BSD 3-Clause "New" or "Revised" License
2.33k stars 77 forks source link

Checking for b2sums lead to strange text below command line prompt #455

Closed raffaem closed 1 month ago

raffaem commented 1 month ago

ble version: Bash version:

➜  
GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu) [Arch Linux]
ble.sh, version 0.4.0-devel4+365101cf (noarch) [git 2.45.1, GNU Make 4.4.1, GNU Awk 5.3.0, API 4.0, PMA Avon 8-g1, (GNU MPFR 4.2.1, GNU MP 6.3.0)]
starship, version 1.19.0 (rustc 1.78.0 (9b00956e5 2024-04-29) (Arch Linux rust 1:1.78.0-1), 2024-05-15 19:07:12 +00:00)
zoxide, version 0.9.4 (/usr/bin/zoxide)
atuin, version 18.2.0 (/usr/bin/atuin)
locale: LANG=en_US.UTF-8 LC_TIME=en_DK.UTF-8
terminal: TERM=xterm-kitty wcwidth=15.0-west/15.1-2+ri, kitty:0 (1;4000;35)

When I check for b2sums, after checking the text

(nsearch#1: << !510 >>) `'

appears below the command prompt and the keyboard doesn't work correctly.

I have to press Enter to clear the text and have the keyboard work correctly again.

Here is an example with the Arch Linux b2sums file:

image

akinomyoga commented 1 month ago

Thanks. The text shown below the prompt is the indicator for the non-incremental search (nsearch - Manual §4.11). This is shown when ble.sh is in the nsearch mode. This means that you fall into the nsearch mode for some reason.

However, I do not seem to be able to reproduce the problem. I tried it in Fedora 39 and Arch Linux with random files (but haven't tried the Arch Linux ISO image suggested in the image).

$ echo hello > tmp.txt
$ b2sum tmp.txt > tmp.b2sum
$ b2sum --ignore-missing --check tmp.b2sum
<-- What is the behavior here?
$ cp .bash_history .bash_history.backup     # <-- back up your command history
$ INPUTRC=/dev/null bash --norc --noprofile # <-- start plain Bash session
$ source /path/to/ble.sh --norc
$ b2sum --ignore-missing --check archlinux_b2sums.txt
<-- Does the problem happen here?

After testing, command history might be truncated. You can restore the command history by running the following command:

$ cp .bash_history.backup .bash_history
$ ble/debug/keylog#start
$ b2sum --ignore-missing --check archlinux_b2sums.txt
<-- Reproduce the problem here. Exit the nsearch mode by pressing RET, and proceed
$ ble/debug/keylog#end
<-- Here, the summary of the data ble.sh received is printed.

Could you provide the output of the last command?

raffaem commented 1 month ago

I also can't reproduce it anymore ... well at least I learnt about non-incremental search.

Will re-open in case it happens again.

Sorry for the annoyance.

akinomyoga commented 1 month ago

OK, no worries.