From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16276 invoked by alias); 14 Oct 2016 21:33:12 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39643 Received: (qmail 29577 invoked from network); 14 Oct 2016 21:33:12 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f172.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.172):SA:0(0.0/5.0):. Processed in 0.307899 secs); 14 Oct 2016 21:33:12 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.172 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ZLAnJLXQsyqfCtLX3V4Qh2fyMREnbcbEifgF0Ao91zs=; b=N98YBx0hoLQ9+DX1MIPL5ydwllUvSA6BBl7eP/IZdBxvCsZszFBIjbZWdPeVM8RTM2 nqHMaZjF9oALZlZfQ9k1Hb9YMMICP5M6bpS7seqMSl/q1BIcerhj2jqVngys5cBoZkqS 0U4XfAmR7s0ILGDvmVqDToW/HPjf4/FYhrpPGU81cZRbuIxQqTxjxB8a3QGzmkpqaJ4o JTzNRoEUczs2yGSDOGznq3hJ7SJRQC97rosreC5n257/cKDM1B8r6GlX6iIjE8zVL6HP 3MI5GTEXTdJhra8im/Lnw8GtkVS0sIjOt45fbf7Qd0Wve5mJ7TTHUBuQfnxP4eLtB6nC Pnsw== X-Gm-Message-State: AA6/9Rk+SmNZIurVESy3zJGRaV74jaC14yjLKt3Xtn45l+hDtxWsbetdHfGUUUhF6s/BgD7O0xSpGR7JG1ltHw== X-Received: by 10.55.140.199 with SMTP id o190mr3869993qkd.299.1476470146389; Fri, 14 Oct 2016 11:35:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Sebastian Gniazdowski Date: Fri, 14 Oct 2016 20:35:26 +0200 Message-ID: Subject: Re: $history[@] doesn't contain last element from $HISTFILE To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On 14 October 2016 at 19:44, Bart Schaefer 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