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 39643
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: $history[@] doesn't contain last element from $HISTFILE
- Date: Fri, 14 Oct 2016 20:35:26 +0200
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ZLAnJLXQsyqfCtLX3V4Qh2fyMREnbcbEifgF0Ao91zs=; b=OOrvQu1x0ZUiONVdqgFPPZHaKzTAk6/hIt+GtZpHDCtHXUJv+j7NMmDNgtNCUG2XiT YOLmY16Gx/D/KUX8HcSBTSTGHxVl12djKGF/EvwZs2BDUZnv9/6F3HS7zgk9AoYgqL6L v33hhp9Lr7eApPBoGPN3xLCb5sDaA63bs+rntczCPcQzcmFvdPlBb4VIL9hqs+kKPqJ3 Nsc6+DaUa5hDw4k6yypm6WR4SWg/oaek5pw+o0etnkx4rCYg8JgRHcC4j7b4Yl8zx658 8/vDkle91uUTspTB6h/Lx5izufc33KTgVYjlxi8LDxQOEXZnElKy+ZhLZuWo/HZIKhys cswA==
- In-reply-to: <CAH+w=7bxHu3D1O5JPOAOi0mokXtzJY7iFCTJrV90izqmemAH1w@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> <CAH+w=7bxHu3D1O5JPOAOi0mokXtzJY7iFCTJrV90izqmemAH1w@mail.gmail.com>
On 14 October 2016 at 19:44, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.
It's fine if it's not an unpredictable thing, I can stick to the
workaround (now not actually a workaround), not having to do an
is-at-least call in return. Although I'm not sure if by
$history[$HISTNO] you mean $history[$size], if there is something
unexpected there, it would be a problem.
Best regards,
Sebastian Gniazdowski
Messages sorted by:
Reverse Date,
Date,
Thread,
Author