Change setting of arrow keys for history in BASH (Fedora Core 2 Wishlist)

Behdad Esfahbod behdad at cs.toronto.edu
Sat Dec 13 17:52:37 UTC 2003


You can always enable backward-searching using ctrl-R.  BTW, it
happens a lot that in the middle of writing a command, you go
back and force and look up something in previous commands you
have types.  So the current behaviour is not useful.  And it has
been like this for such a long time that cannot be changed.

behdad

On Sat, 13 Dec 2003, Jaap A. Haitsma wrote:

> Hi,
>
> Standard the up arrow and the down arrow are bound to "previous-history"
> and "next-history" respectively.
>
> I changed these to "history-search-backward" and
> "history-search-forward" respectively by adding the following to lines
> to /etc/inputrc
>
> "\M-[A":history-search-backward
> "\M-[B":history-search-forward
>
> If you have not typed anything on the prompt and use the arrow keys the
> behaviour is identical to the behaviour of "previous-history" and
> "next-history".
>
> However if you type something (a beginning of a command) and then use
> the arrow keys it will search backward or forward in the history trying
> to find a command of which the first charaters match to the ones your
> type. This is a very powerful feature.
>
> To demonstrate it here's an example
> For example I use cvs over the internet quite a bit. To login I have to
> type something like "cvs -d :pserver:jaap at haitsma.org/cvs login" Now on
> the next day I want to login again with the proposed feature enabled I
> only type cvs -d and then the up arrow.
>
> Really cool thing of this is that the normal behaviour of the arrow keys
> does not change while you get a very powerful feature
>
> Jaap
>
>
> --
> fedora-devel-list mailing list
> fedora-devel-list at redhat.com
> http://www.redhat.com/mailman/listinfo/fedora-devel-list
>
>





More information about the fedora-devel-list mailing list