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

Re: $history[@] doesn't contain last element from $HISTFILE



This is a side-effect of the implementation of history, specifically
that even with HISTSIZE=0 there is always one line (the immediately
previous command) available for recall with up-history.  Hence that
final line is not actually "committed" into the history until the NEXT
line is read, at which time it either goes into the history "for real"
or is discarded.

I pass no judgement at this time on Sebastian's assertion of whether
the contents of $history[@] "should be" different, though it is
potentially unexpected that $history[$HISTNO] is special-cased.



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