Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse intelligent search (reverse-i-search), how to get previous result? [closed]

When doing reverse intelligent search on a terminal (Ctrl+R), I can keep pressing Ctrl+R to go back in "history" and get older commands containing my search string.

How can I move back to a result which I have already displayed (a previous search result)?

like image 483
Vincenzo Pii Avatar asked Jul 20 '13 08:07

Vincenzo Pii


1 Answers

I want to leave a reference for people who may find this, as the linked question actually asks for something else (even if one of the answers contains the solution to this problem).

The key binding to move forward is CTRLS.

The problem is that this binding, in many terminals, is used by default to send the pause transmission code (XOF).

As in man stty:

   [-]ixon
          enable XON/XOFF flow control

So, if you have this option enabled on your terminal (the output of stty -a contains ixon withouth the - sign in front), you cannot use CTRLS in the context of reverse-i-search.

To disable it, use the following command:

stty -ixon

And CTRLS will give you a (i-search) (non reverse).

like image 64
Vincenzo Pii Avatar answered Sep 20 '22 13:09

Vincenzo Pii