Re: Problems with history

"Mark J. Reed" <[email protected]> Mon, 15 Dec 2025 13:48:45 -0500
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAA=-s3yDg2Xd4-Mui-fpfhkRZit9zCAAoN7EpT8puWZPOTPd8w@mail.gmail.com>
If you have `extended_history` set, then your history file should have
timestamps.

Just for the sake of covering bases, you have tried echoing `$HISTSIZE` and
`$SAVEHIST` to make sure that your settings are being loaded as you think?
When you say "my login file", do you mean `.zprofile`?



On Mon, Dec 15, 2025 at 11:19 AM Perry Smith <[email protected]> wrote:

> I’ve battled this problem before and I thought I had a fix but I guess
> not.  I’m asking for help on how to debug this.
>
> I want my history to be very large.
>
> I’m on macOS 26
> /bin/zsh —version reports zsh 5.9 (arm64-apple-darwin25.0)
> /opt/homebrew/bin/zsh —version reports zsh 5.9 (arm-apple-darwin22.1.0)
> I’m assuming Terminal uses /bin/zsh
>
> In my login file I have:
>
> : ${HISTFILE:=${ZDOTDIR:-$HOME}/.zsh_history}
> SAVEHIST=1048576
> (( HISTSIZE = SAVEHIST * 2 ))
>
> For those familiar with macOS’s zsh per session history I have this in my
> .zshenv:
>
> # Stop the Apple Terminal session history
> export SHELL_SESSIONS_DISABLE=1
> export SHELL_SESSION_HISTORY=0
>
> The system’s /etc/zshrc has these lines:
>
> # Save command history
> HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
> HISTSIZE=2000
> SAVEHIST=1000
>
> Yet my history when I first open a Terminal stays at around 1000 lines.  I
> have EXTENDED_HISTORY set yet my history file (1000 lines) only goes back
> to 12/15/2025 (today)… Oh… Hmmm… I guess when the history is read in, the
> time and date is not saved?
>
> Some questions that would help me:
>
> When is the history file read in?
> Does setting HISTSIZE or SAVEHIST cause the current history list to get
> truncated?
> Is there any other things I should check?
>
> Thank you for your help,
> pedz
>
>
>
>

-- 
Mark J. Reed <[email protected]>