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

Re: Problems with history



On Mon, Dec 15, 2025 at 8:18 AM Perry Smith <pedz@xxxxxxxxxxxxxxxx> wrote:  

/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

You could `print $ZSH_PATCHLEVEL` from the PS1 prompt to confirm
 
When is the history file read in?

Pretty much the last thing before the prompt is printed, definitely after all the startup files are read UNLESS one of those files contains an "fc" or "history" command.
 
Does setting HISTSIZE or SAVEHIST cause the current history list to get truncated?

HISTSIZE truncates the shell's internal history list, yes.  SAVEHIST won't kick in until the history is written back to HISTFILE.
 
Is there any other things I should check?

As an addenda to Mark Reed's comments, you could try printing the values of the history variables in your .zlogout file (follow that with a `sleep` so you have a chance to see the output).


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