Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [RFC PATCH 3/3] FAQ: sync newuser-install



On Wed, Aug 24, 2022 at 3:11 PM Eric Cook <llua@xxxxxxx> wrote:
>
> On 8/24/22 16:03, Felipe Contreras wrote:
> > Starting the shell without dotfiles does not produce the behavior you
> > described, this isn't the corner-case. The corner-case you described
> > is more specific.
>
> Yes, it currently doesn't because HISTFILE isn't set by zsh by default.
> a startup file has to do this, but if
>
> > I actually think this should be the default, no need for *everyone* to
> specify this.
>
> the `this' here is setting HISTFILE, you will create a situation where
> unintentional data loss happens if zsh sets HISTFILE by default, a user
> increases SAVEHIST from the default and starts zsh without their dotfiles.
> Those three conditions would cause the shell to truncate HISTFILE back to
> the default value of SAVEHIST.

So it's more than one condition, so it's more than just starting with
NO_RCS. That's what I meant by "more specific".

*If* my proposed patches are applied, SAVEHIST by default would be
1000, *and* if HISTFILE had some default--which is something my
proposed patches don't do, but could be considered for zsh 6.0, *then*
this could happen:

1. The user has configured SAVEHIST to something greater than 1000
2. The user starts zsh with NO_RCS (e.g. zsh -f)

Yes, that is an issue, but I would guess those two conditions would
only be met 0.01% of the time at best, which is why I claim this is a
corner-case. Moreover, this could be easily avoided by HISTFILE not
having a default if NO_RCS is set, could it not?

-- 
Felipe Contreras




Messages sorted by: Reverse Date, Date, Thread, Author