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

Devin Teske devin at shxd.cx
Mon Oct 30 18:39:48 UTC 2017


> On Oct 30, 2017, at 8:16 AM, Alexey Dokuchaev <danfe at FreeBSD.org> wrote:
> 
>> On Mon, Oct 30, 2017 at 09:47:22AM -0500, Dan Mack wrote:
>> ...
>> I use ESC-P / ESC-N a lot; it's a neat feature that tcsh has had for a
>> long time, maybe since the beginning.  However it's a tcsh feature, not
>> sh, bash, or csh IIRC.  But csh is actually tcsh on FreeBSD but I'm sure
>> most people already know this on this list.
> 
> It is the same as up/down arrows?  

In tcsh/zsh if you do not type anything first, it is like up/down arrows.

If you type something first, the list is filtered by "begins with" given what you have typed thus-far.

> Yeah, one of the best tcsh(1) features!
> 

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

>> To emulate this behaviour in bash, I simply create a .inputrc file in my
>> $HOME with the following contents:
>> 
>> # .inputrc field
>> "\ep": history-search-backward
>> "\en": history-search-forward
> 
> On GNU/Linux boxes mine has:
> 
>  "\e[A": history-search-backward
>  "\e[B": 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 would then be the case that you cannot navigate the history sequentially unless the input line is empty before using cursor-up/cursor-down.
-- 
Devin




More information about the svn-src-head mailing list