Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SSD-friendly history
- X-seq: zsh-users 28182
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: dominik.vogt@xxxxxx, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: SSD-friendly history
- Date: Wed, 5 Oct 2022 15:50:43 -0700
- Archived-at: <https://zsh.org/users/28182>
- In-reply-to: <Yz34Wf67KJolrztr@localhost>
- List-id: <zsh-users.zsh.org>
- References: <Yz34Wf67KJolrztr@localhost>
On Wed, Oct 5, 2022 at 2:34 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> I'd really like to have a mechanism that appends to the history
> until some maximum size is reached and then truncates it to some
> much smaller size
Setting INC_APPEND_HISTORY will cause the file to be rewritten only
when it reaches 20% larger than SAVEHIST. There's no option to make
that greater than 20% at this point.
However, this would be a reason to make SAVEHIST a lot larger than
HISTSIZE. If you don't mind using size-in-bytes instead of
size-in-lines, you could then add a fast check to .zlogout to set
SAVEHIST=$HISTSIZE whenever $HISTFILE is large enough.
(( $(zstat +size $HISTFILE) > 2000000 )) && SAVEHIST=$HISTSIZE
or similar.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author