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

Re: [4.0.2 bug] commands not written to history



On Thu, 12 Jul 2001, Bart Schaefer wrote:
> And I hadn't realized that INC_APPEND_HISTORY
> causes the elapsed-time to be lost from the entries, but that makes
> sense because they're written out before the command has finished.

Yeah.  My original patch wrote the commands out when they finished, but
some folks were expecting the command to be present before it completed
(when sharing the history among multiple shells), so I changed it.  I
suppose there might be ways to try to update the elapsed time values
when a shell rewites the history file, but that's probably too much
complication for too little reward.

> I just noticed looking at the history code that using INC_APPEND_HISTORY
> acts like SHARE_HISTORY each time $HISTFILE exceeds $[SAVEHIST*1.2]
> entries.  That is, the history file is re-read and then written in order
> to truncate it back down to $SAVEHIST entries, so any interleaved
> entries from multiple simultaneous shells will become interleaved in the
> shell that performed the truncation, but remain independent in all the
> other shells.

No, that code creates a separate history buffer to do the rewriting, so
it should not affect the in-memory history (unless there is a bug).

..wayne..



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