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

Re: Failing to write to history file if containing directory doesn't exist



On Mon, Oct 08, 2007 at 06:44:45PM -0700, Bart Schaefer wrote:
> } Only under the condition that HISTFILE is written to between the two
> } commands.
> 
> Which will be always, if the SHARE_HISTORY and/or INC_APPEND_HISTORY
> options are set.

Exactly so.

> } I still want to play a "don't lose data without trying to save it"
> } card, but it seems I'm the only one playing cards of that suite.
> 
> History is only maintained for interactive shells, so you might get
> more traction with an option to prompt the user to create the directory
> and/or fix $HISTFILE when the file does not exist or is not writable.

Along that vein, and still leaning towards a solution in shell code,
might it be reasonable to put a precmd hook into the default
/etc/zshrc to check up on HISTFILE?  That seems like a compromise that
allows everyone to get it but for it still to be maintained in shell,
rather than c.

~Matt Wozniski



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