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

Re: can't write zsh_history



On 2006-10-13 at 07:27 -0700, William Scott wrote:
> luser-%  sudo zsh
> root-#   (various nefarious evildoing)
> root-#   exit
> zsh: can't write history file /Users/luser/.zsh_history
> 
> (I call it .zsh_history, BTW).
> 
> Even "sudo zsh -l" doesn't help.  $HISTFILE never changes.

I strongly suspect that somewhere in your zsh startup files, you're
exporting HISTFILE to the environment.  The variable is used by tcsh
too, so tcsh will then be seeing the value and writing data in its own
format.  zsh later does sanity checks when writing its history, so
complains.

HISTFILE should be set, but not exported, being an internal control
variable.

In zsh:
% env | grep '^HISTFILE='

Regards,
-Phil



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