On 2/13/14 6:35 AM, Ed Avis wrote:
> Bash accepts the Emacs keybinding C-p to go back in the history, and C-n to
> go forward.
> But most of the time in Emacs (when using its minibuffer) the keys you use
> are Meta-p
> and Meta-n, or on a modern PC keyboard Alt-p and Alt-n.
I am not convinced that Alt-p and Alt-n are any more widely used than C-p
and C-n, but in any event, it's easy to bind whatever key sequence those
key combinations produce to the same editing functions as C-p and C-n.
I would further argue that the number of people using an emacs minibuffer
to run their shell commands is a small fraction of the total number of
bash users. The folks doing that are more than capable of adding a key
binding or two.
> Currently entering M-p at the bash prompt gives some control characters.
Because that key sequence is unbound. Take the key sequence that you see
and bind it to previous-history, e.g.,
"\e[A":previous-history
(where \e is ESC, or meta)
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/