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

Re: reading/saving history file dependent on isset(RCS)

>>>>> On October 21, 2011 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> On Oct 20, 12:55pm, Greg Klanderman wrote:
> } 
> } Based on there being no default setting for HISTFILE, can the
> } isset(RCS) check can be safely removed for the readhistfile() call?

> Something you said tripped a synapse.

> No, this can't be safely removed.

> I now seem to recall that this was added when sourcing /etc/zshenv was
> exempted from NO_RCS.  If the system zshenv sets HISTFILE or SAVEHIST,
> then you can get bad side-effects even with "zsh -f" unless NO_RCS
> suppresses history file management.

Thank you for looking into this Bart.  Do you still object if both the
guard against reading and saving are removed?  In that case, if
/etc/zshenv were to set HISTFILE/SAVEHIST, then the HISTFILE should
not get clobbered.  I guess given the multitude of ways one could get
shot in the foot via stuff in /etc/zshenv, guarding against just this
one seems a bit pointless, but I can deal with it.

Hmm one other proposal for you to consider - how about changing the
logic to use the value of isset(RCS) from *before* any init scripts
were loaded to condition reading/saving the history file?  In that
case, 'zsh -f' would inhibit history reading/saving, but having
'setopt norcs' in one of your init scripts would not.


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