At times when I do CtrlR to search through command history, I find that I don't reach the entry I was looking for, even though I know it's in history. I think this is due to me having passed the entry, forcing me to use another command to go the other direction. Is there a command that allows the whole of history to be searched by looping through it (restarting the cycle) when it reaches the end?
You could use Alt+> to go back to the end of your history then search again, but maybe you knew that, and it's not what you want.
Unfortunately, I don't think there's a way to make it wrap around.
I can't see anything about it in
We could try writing a
So short of that, here's some other suggestions that you might find viable alternatives:
If your terminal is configured to send Ctrl+S, (e.g. by running
You could use
If that's too long to type, make it a function to save some typing, e.g.
Plus you can change directions just by pressing the other shortcut, e.g. if you're at the oldest command, you can just switch from pressing Alt+P to pressing Alt+N.
Set it up by putting this in your
and this in your
You could even go one step further and make the Up arrow do this.
Finally, are you sure the command is being entered into history? Maybe it's being ignored due to the