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

Re: [PATCH] EXTENDED_HISTORY documentation typo



On Oct 27,  3:51pm, Mikael Magnusson wrote:
}
} When I enable extendedhistory and run a command for a few seconds (in
} the foreground), the <elapsed seconds> field is always 0.

Hrm.

torch% history -dD
    1  08:09  0:00  setopt extendedhistory
    2  08:12  0:30  sleep 30
torch% SAVEHIST=50
torch% fc -W /tmp/ehist
torch% cat /tmp/ehist
: 1319728176:0;setopt extendedhistory
: 1319728336:30;sleep 30
: 1319729722:0;history -dD
: 1319729869:0;SAVEHIST=50

(Timestamps are a bit far apart because I was distracted by phone call
while doing this).

Here's a thing ... if you're using a zshaddhistory hook to store lines
to the history with "print -s" or "print -S", the start time of the
command is lost and consequently so is the elapsed time; print forces
the start and end times of the entry it writes to both be the time of
the call to print.

There may be a similar issue with HIST_IGNORE_ALL_DUPS in that the times
for the oldest duplicate are kept, whereas HIST_EXPIRE_DUPS_FIRST keeps
those of the most recent duplicate.



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