zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: reading/saving history file dependent on isset(RCS)
Date: Mon, 24 Oct 2011 10:08:17 -0700	[thread overview]
Message-ID: <111024100817.ZM7342@torch.brasslantern.com> (raw)
In-Reply-To: <m3zkgu74dl.fsf@klanderman.net>

On Oct 21, 11:26am, Greg Klanderman wrote:
} Subject: Re: reading/saving history file dependent on isset(RCS)
}
} >>>>> On October 21, 2011 Bart Schaefer <schaefer@brasslantern.com> wrote:
} 
} > 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?

The problem in part is that "-f" is supposed to mean "fast".  If the
global zshenv sets HISTFILE and someone has 10,000+ lines of saved
history (and yes, some people do) then "zsh -f" suddenly becomes very
slow and bloated.

} In that case, if
} /etc/zshenv were to set HISTFILE/SAVEHIST, then the HISTFILE should
} not get clobbered.

In what way is it not clobbered?  Commands added to history during the
shell session will be saved when they weren't before, and some history
may consequently roll off the top; or what if /etc/zshenv also sets
SAVEHIST or HISTSIZE to something smaller than the user's value?

What if the user normally DOES NOT save history?  What if the history
file is shared among multiple running shells?

} 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.

Most of the ways one can get messed up by /etc/zshenv don't get written
to a file or propagated around by runtime sharing.

} 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?

That has some promise, but then how do you give the ability to override
it to someone who *wants* to turn back on saving of the history?

However, at the least we should put an explanation of all this in the
FAQ or the docs.


      reply	other threads:[~2011-10-24 17:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19 18:34 Greg Klanderman
2011-10-19 18:48 ` Benjamin R. Haskell
2011-10-20  7:10   ` Bart Schaefer
2011-10-20 16:55     ` Greg Klanderman
2011-10-21 12:40       ` Bart Schaefer
2011-10-21 15:26         ` Greg Klanderman
2011-10-24 17:08           ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=111024100817.ZM7342@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).