Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eshell search history

I'm using emacs eshell and would like to search back through my command history. In bash you would do C-r then type something and then press C-r repeatedly until you find the command you want. On eshell it seems I have to type M-r and then type part of the command and press enter then type M-r and enter again to get the next match and so on. This means I have to keep doing M-r {enter} M-r {enter} M-r {enter} again and again rather than just pressing C-r again and again without moving my hands, is there a better way? There's not much info out there on eshell.

like image 911
shmish111 Avatar asked Oct 22 '12 10:10

shmish111


1 Answers

If the string that you are searching for is in the beginning of the command, then eshell-previous-matching-input-from-input UP, M-p or C-c M-r is much friendlier than eshell-previous-matching-input M-r.

You can type the first few characters of the command and press UP or M-p key and it will cycle only through the matching commands in the history.

like image 53
Praveen Kumar Avatar answered Sep 27 '22 17:09

Praveen Kumar