Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2017 11:39:46 -0700
From:      Devin Teske <devin@shxd.cx>
To:        Alexey Dokuchaev <danfe@FreeBSD.org>
Cc:        Dan Mack <mack@macktronics.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Eitan Adler <eadler@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, Cy Schubert <Cy.Schubert@komquats.com>, Ed Maste <emaste@freebsd.org>, Warner Losh <imp@bsdimp.com>
Subject:   Re: svn commit: r325092 - head/usr.bin/fortune/datfiles
Message-ID:  <3CB26689-0D12-4E69-9BBA-58CCC3B71F3F@shxd.cx>
In-Reply-To: <20171030151627.GA74374@FreeBSD.org>
References:  <201710291851.v9TIpM0I073542@slippy.cwsent.com> <B855A05D-E1BB-485F-AB8D-9F9656F531CC@shxd.cx> <m28tfsofph.fsf@macktronics.com> <20171030151627.GA74374@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


> On Oct 30, 2017, at 8:16 AM, Alexey Dokuchaev <danfe@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





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CB26689-0D12-4E69-9BBA-58CCC3B71F3F>