Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search backwards in emacs shell?

Tags:

shell

emacs

I love emacs shells, but there is a confusing thing for people used to use the gnome shell (like me). The backwards search does not work the same way. C-r searches in the buffer, not in the command history, and M-r searches in the command history but when pressed twice toggles between direct and regexp search, i.e. does not search for the previous match in the command history. So, how to do that?

Edit: The shell I was looking when I wrote this is what you get with M-x shell, I didn't know there were other shells in emacs. See e.g. https://plus.google.com/112537550357635435516/posts/Wgpk2mH6hQh

like image 961
boclodoa Avatar asked Nov 26 '12 18:11

boclodoa


1 Answers

Type M-r , search for something, and then press C-r to repeat the same search in the command history.

like image 133
Tom Avatar answered Sep 20 '22 06:09

Tom