Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2017 16:35:04 -0500
From:      Dan Mack <mack@macktronics.com>
To:        Devin Teske <devin@shxd.cx>
Cc:        Alexey Dokuchaev <danfe@FreeBSD.org>, "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:  <m2k1zc5ng7.fsf@macktronics.com>
In-Reply-To: <3CB26689-0D12-4E69-9BBA-58CCC3B71F3F@shxd.cx> (Devin Teske's message of "Mon, 30 Oct 2017 11:39:46 -0700")
References:  <201710291851.v9TIpM0I073542@slippy.cwsent.com> <B855A05D-E1BB-485F-AB8D-9F9656F531CC@shxd.cx> <m28tfsofph.fsf@macktronics.com> <20171030151627.GA74374@FreeBSD.org> <3CB26689-0D12-4E69-9BBA-58CCC3B71F3F@shxd.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
Devin Teske <devin@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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?m2k1zc5ng7.fsf>