Re: Problems working with bash.
> Still, none of this even begins to compare with the ease of use of
> (horror! shock!) the DOS command interpreter 4DOS! Why use separate
> keys like M-p for this, when you've got the arrow keys? The principle
> is this: if you have an empty commandline and you type the up arrow, you
> get the previous command. If you've already typed something, you get
> whatever previous command starts with that. This combines the two
> functions that bash uses (and needs two keys for) into one. I wish I
> could convince bash to work like this!
>
> Gertjan.
You can do this with tcsh and bash.
In tcsh, write
bindkey -k up history-search-backward
bindkey -k down history-search-forward
in your ~/.tcshrc file.
In bash, write
"\e[A":history-search-backward
"\e[B":history-search-forward
in your ~/.inputrc file. There are two problems with bash, though.
First, if you log on your linux machine with a terminal that does not
use ESC [ A for the up arrow, you will have to define another sequence.
Second, if you have not already typed something on the command line,
history-search-backward does not match any previous command in the
history and just beeps. 4DOS and tcsh just match all the commands
instead and show you the first match. I have read that this is fixed
in bash 2.0, at last, but did not try it yet.
--
Michel Beland beland@CERCA.UMontreal.CA
professionnel de recherche tel: (514)369-5223 fax: (514)369-3880
CERCA (CEntre de Recherche en Calcul Applique)
5160, boul. Decarie, bureau 400(423), Montreal (Quebec), Canada, H3X 2H9
Reply to: