Assign_arrow_keys_to_history_search_in_bash

1
2
3
4
"\e[A": history-search-backward
"\e[B":history-search-forward
set show-all-if-ambiguous on
set completion-ignore-case on

在 /etc/inputrc
或者 ~/.inputrc 里加上如上配置,重新登录shell就行了

http://hints.macworld.com/article.php?story=20031026174236860

With Panther, the default shell is now Bash. I had customized my tcsh shell using this hint In bash you can get similar results by adding this to your .bash_profile

1
2
bind '"M-[A":history-search-backward'
bind '"M-[B":history-search-forward'

where M-[A is the up key and M-[B is the down key.