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

Re: Bug: Losing .zsh_history



On Wed, Oct 05, 2022 at 09:05:44PM +0000, Wesley wrote:
> On 10/5/22 16:20, Dominik Vogt wrote:
> > On Wed, Oct 05, 2022 at 04:01:01PM -0400, Eric Cook wrote:
> >> On 10/5/22 15:55, Dominik Vogt wrote:
> >>> Due to some hardware problem with the display adapter my box
> >>> sometimes fails to show anything on the screen but just emits some
> >>> error beeps while it boots.  Since I cannot log in and stop the
> >>> machine without the screen, I can only switch off the power.
> >>>
> >
> > So, I can say with certainty that when this happened I used vim to
> > look at the history file in a 80x24 terminal window and that
> > showed all "^@"s (i.e. 23 lines * 40 nulls = 920 nulls).  I'm not
> > sure whether I looked at any other portion of the file, but
> > normally I'd check the last line too.  I definitely didn't check
> > what was in between and definitely didn't see anything but nulls.
> > (The last line may be identical to the first line.)
>
> This might be interesting to read:
> https://unix.stackexchange.com/a/273869

Interesting.  Actually, my .zsh_history is always "full", so every
time a shell updates the history some of the oldest entries are
removed, i.e. there's normally not a simple append operation.
Appending won't destroy the first line of the file.

> What are your history options btw?

Starting with the default, these are the changes:

  setopt APPEND_HISTORY
  unsetopt BANG_HIST
  setopt HIST_IGNORE_DUPS
  setopt HIST_FIND_NO_DUPS
  setopt HIST_IGNORE_SPACE
  setopt HIST_VERIFY
  setopt HIST_EXPIRE_DUPS_FIRST
  HISTSIZE=100500
  HISTFILE=~/.zsh_history
  SAVEHIST=100000
  setopt HIST_REDUCE_BLANKS

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt




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