svn commit: r325092 - head/usr.bin/fortune/datfiles

Dan Mack mack at macktronics.com
Mon Oct 30 21:35:12 UTC 2017


Devin Teske <devin at shxd.cx> writes:

> Better in bash which allows you to filter not only on "begins with"
> but also "contains" (which is arguably more valuable than "begins
> with").

Definately different. Better? Maybe for some.  I most always search
command history by prefix and then just using multiple ESC-p invocations
to find the one command to edit/re-execute.  Less frequently I want to
search the whole text of history for the whole command line sequence
like bash Ctrl-R accomplishes.

>>> To emulate this behaviour in bash, I simply create a .inputrc file in my
>>> $HOME with the following contents:
>>> 
>>> # .inputrc file
>>> "\ep": history-search-backward
>>> "\en": history-search-forward

> Interesting that you mapped these to cursor-up/cursor-down.
>
> That may cause unexpected results.

> For example, typing something and then pressing up-arrow will cause
> the shell to give you the previous command that started with that
> rather than the previous command in-general.

It's ESC-p/ESC-n, not just plain up-arrow/down-arrow.  Up arrow still
does up without any search.  At least with my config using \ep as shown.
My up arrows work for me as expected - they just iterate forward and
backward through shell history.

Dan



More information about the svn-src-head mailing list