Cancel unsuccessful reverse-i-lookup in bash, but keep what I typed

I hit Ctrl + R almost every time I run a command, but after entering a word (for example, find) I understand that the command is not in my history, so I get it as expected:

(failed reverse-i-search)`find`: cat fire.txt

Now how do I cancel the search, but save the "find" in my command line? No matter which key I press "cat fire.txt", it ends on my command line and I need to erase and re-enter my command again.

I am using Ubuntu. Thanks.

+8
source share
1 answer

, , , - ( i-).

history-search-backward , .

history-search-backward()

. . . .

, , ( ).

: , - , bash NEWS 4.3 ,

.          (history-substring-search-forward, history-substring-search-backward)

, , readline ( readline ) .

0

Source: https://habr.com/ru/post/1613274/


All Articles