zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: issues with saving history to file
Date: Sat, 16 Mar 2024 08:41:00 -0700	[thread overview]
Message-ID: <CAH+w=7ZAAJsRdOXkY4jx2OD+05FrHcAWyNrru740MLMx2BwzTA@mail.gmail.com> (raw)
In-Reply-To: <20240315124750.GB3738413@cventin.lip.ens-lyon.fr>

On Fri, Mar 15, 2024 at 5:47 AM Vincent Lefevre <vincent@vinc17.net> wrote:
>
> On 2024-03-13 21:52:44 -0700, Bart Schaefer wrote:
> > On Wed, Mar 13, 2024 at 8:05 AM Vincent Lefevre <vincent@vinc17.net> wrote:
> > > IMHO, HISTFILE should just be unset by default; but if the user sets
> > > this parameter, I suppose that the goal is to save the history.
> >
> > The goal might be to read the history, not to write it.
>
> To read the history?  The zshparam(1) man page just says "to save":
>
>   HISTFILE
>       The file to save the history in when an interactive shell exits.

See also the part about "when exits" which is clearly also incorrect.
This entry is outdated.  The shell also initializes the history from
this file at startup.

I was differentiating
  zsh -f
  % setopt RCS
from
  zsh
  % setopt no_RCS

In the former case, the history is not read, but it is written.  In
the latter case it is read, but not written.  The point being that
merely setting HISTFILE does not imply that the goal is to save to it.
Further, setting SAVEHIST=0 will truncate the file in the former case
and leave it alone in the latter case.  There's no single setting that
covers all cases, which is part of the reason we've so far had trouble
agreeing on default behavior.

If anyone wants to have a go at cleaning up all these documentation
inaccuracies, please do.


      reply	other threads:[~2024-03-16 15:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-13 15:05 Vincent Lefevre
2024-03-14  4:52 ` Bart Schaefer
2024-03-15 12:47   ` Vincent Lefevre
2024-03-16 15:41     ` 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='CAH+w=7ZAAJsRdOXkY4jx2OD+05FrHcAWyNrru740MLMx2BwzTA@mail.gmail.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).