From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24836 invoked by alias); 14 Oct 2016 17:52:34 -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: 39640 Received: (qmail 8984 invoked from network); 14 Oct 2016 17:52:34 -0000 X-Qmail-Scanner-Diagnostics: from mail-qt0-f176.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.216.176):SA:0(0.0/5.0):. Processed in 0.80544 secs); 14 Oct 2016 17:52:34 -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=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) 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== 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; bh=qtUPQuiaHwL7yjyZBy65SlzvSr6HjIkGoUOrKYMmv2g=; b=kOVbMXWt851fI7//yGbORFaz6/97qzBbo1K7IzU250T4kavOkCY5zBkxrgwvlCELzB oOrtM1fCSb3E/eZI0ScQGfwJJD1E8Epv7V+TJOdj5YK1ptq9yqk+RDLGSJnuawkGkjyr frcncowcm3YciUJFduH9wdwwY5hn91btNVTx457wUrFugUyEe/bt5QKr2i1PrZblSKig gxwt7a2+x7URvusNvmSvXOBSbvtGQQ2x91jiSWrDyul8nl6vDgMArl3AIE6SXlYw4hlF cMV1CjfGYBpk/E/wFF5hn45LpM1KSRiU1xIviMXdlqtioG2UMO5trs06/o4wLOPLtggq owYA== X-Gm-Message-State: AA6/9Rlrnnye6qJ30IlElcoH91YoXbFuBL8A0Y69JnfFiMFw3k8VYDzaPG4tOnwF6/ha04IPT7zKyn6fX/aZDA== X-Received: by 10.237.36.28 with SMTP id r28mr11991068qtc.99.1476467075284; Fri, 14 Oct 2016 10:44:35 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Bart Schaefer Date: Fri, 14 Oct 2016 10:44:34 -0700 Message-ID: Subject: Re: $history[@] doesn't contain last element from $HISTFILE To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 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.