NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: HISTFILE support for /bin/sh



At Fri, 05 Jul 2024 09:08:30 +0700, Robert Elz <kre%munnari.OZ.AU@localhost> wrote:
Subject: Re: HISTFILE support for /bin/sh
>
> I'm also just using the libedit (editline) history facilities - which is
> what sh has always used for its history.   They have supported reading/writing
> files for ages, just sh didn't make use of that functionality (that only
> those minor changes were needed was how I made this stuff mostly work in a
> day and a half...)

Ah ha!  I had forgot that /bin/sh "just" uses libedit.


> Only data typed by the user on stdin ever counts (or more correctly I
> think, only data read by the shell from stdin, in an interactive shell).

That makes sense, especially within the context of using libedit.

I think what you've proposed all makes good sense and fits well into a
simple and elegant /bin/sh!


> ps: if these changes go in, one more I forgot to mention yesterday, is that
> there will be a new "fc" option (-z) to clear the history buffer completely.

If libedit were fixed to allow HISTSIZE=0 to clear the history buffer
(and for the duration disable history), then "fc -z" might be just a
supplemental way to do the same.

Indeed given the current definition of HISTSIZE which you described as
being "the number of history entries that are not allowed to exist" then
for most purposes setting HISTSIZE=1 as a means to (mostly?) clear the
buffer would suffice.

--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpeY0V8kW3QT.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index