From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5472 invoked by alias); 27 Oct 2011 16:12:16 -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: 29873 Received: (qmail 928 invoked from network); 27 Oct 2011 16:12:14 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=+GeXEBe8pap6U1UB31c/IcwI3i4ure7z+Na8FCgGnGQ=; b=S7f0/odRR5WX0j72oc8o/+fg3K0rXR1RIIdLwRZGMeyCTT7Wb6ndKiwY/naoSGqJYI AxS2UPeZe062YaTRrguD1NmuyytdezepMiTUPj74xwKYdIzGFHPtAEriNRAUk0nI8EAo kZAFHVj/Q2h286Qhn8SAjwnF2VFxpVCoxhB6s= MIME-Version: 1.0 In-Reply-To: <111027085718.ZM18523@torch.brasslantern.com> References: <20100328235931.GA23061@ruderich.org> <111027085718.ZM18523@torch.brasslantern.com> Date: Thu, 27 Oct 2011 18:12:08 +0200 Message-ID: Subject: Re: [PATCH] EXTENDED_HISTORY documentation typo From: Mikael Magnusson To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 27 October 2011 17:57, Bart Schaefer wrote: > On Oct 27, 3:51pm, Mikael Magnusson wrote: > } > } When I enable extendedhistory and run a command for a few seconds (in > } the foreground), the field is always 0. > > Hrm. > > torch% history -dD > 1 08:09 0:00 setopt extendedhistory > 2 08:12 0:30 sleep 30 > torch% SAVEHIST=50 > torch% fc -W /tmp/ehist > torch% cat /tmp/ehist > : 1319728176:0;setopt extendedhistory > : 1319728336:30;sleep 30 > : 1319729722:0;history -dD > : 1319729869:0;SAVEHIST=50 > > (Timestamps are a bit far apart because I was distracted by phone call > while doing this). > > Here's a thing ... if you're using a zshaddhistory hook to store lines > to the history with "print -s" or "print -S", the start time of the > command is lost and consequently so is the elapsed time; print forces > the start and end times of the entry it writes to both be the time of > the call to print. > > There may be a similar issue with HIST_IGNORE_ALL_DUPS in that the times > for the oldest duplicate are kept, whereas HIST_EXPIRE_DUPS_FIRST keeps > those of the most recent duplicate. Ah, i have none of those set though, and i don't use a zshaddhistory hook... This is a zsh -f session: % cat /tmp/test HISTFILE=/tmp/test HISTSIZE=50 SAVEHIST=50 setopt incappendhist setopt incappendhistory cat /tmp/test setopt extendedhistory : 1319731616:0;cat /tmp/test : 1319731618:0;sleep 5 : 1319731624:0;cat /tmp/test % history -dD 1 18:06 0:00 HISTFILE=/tmp/test 2 18:06 0:00 HISTSIZE=50 3 18:06 0:00 SAVEHIST=50 4 18:06 0:00 setopt incappendhist 5 18:06 0:00 setopt incappendhistory 6 18:06 0:00 cat /tmp/test 7 18:06 0:00 setopt extendedhistory 8 18:06 0:00 cat /tmp/test 9 18:06 0:05 sleep 5 10 18:07 0:00 cat /tmp/test At first i thought maybe it's one of my local patches, but i get the same result on a remote host running 4.3.10. -- Mikael Magnusson