Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: $history[@] doesn't contain last element from $HISTFILE
- X-seq: zsh-workers 39640
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: $history[@] doesn't contain last element from $HISTFILE
- Date: Fri, 14 Oct 2016 10:44:34 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=qtUPQuiaHwL7yjyZBy65SlzvSr6HjIkGoUOrKYMmv2g=; b=s2z+noIMiyyi3z8YfHJ13dxKGu0VU2OvVMKHZPub+cR8WnsVu/1aLXjJxFz8gzUsMp /9srSbOd5oeZhdlEiirkBokfENf09K32Dd2moTFBe0dYOapG1pgLOCz/qzzgDYXoQ3sR NJayxQiPl1m9pgtmSMfJX2LDQd76orOqD+AhRcITlRXZlX0IxAKT8BLWI6vez5AjSQpA fbs9+QCDZfRBZMsHAhZfdFgtrxKcCyrFLtYPmck1N946RpOvbf45uYltQ2qBW58ExdnU 6Q155iWiIskmOqJEZlmtMOSoZgk3VsL8bYc6UE/sKvbbtERCD8Rqg2UaomIXe3fCYNnZ zx2Q==
- In-reply-to: <CAKc7PVDE94RMgquJtPU5hgBoC0TUSNHzfocZV7DXgajtJME2jg@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDE94RMgquJtPU5hgBoC0TUSNHzfocZV7DXgajtJME2jg@mail.gmail.com>
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