From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1095 invoked by alias); 27 Oct 2011 15:57:27 -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: 29872 Received: (qmail 3593 invoked from network); 27 Oct 2011 15:57:25 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <111027085718.ZM18523@torch.brasslantern.com> Date: Thu, 27 Oct 2011 08:57:18 -0700 In-reply-to: Comments: In reply to Mikael Magnusson "Re: [PATCH] EXTENDED_HISTORY documentation typo" (Oct 27, 3:51pm) References: <20100328235931.GA23061@ruderich.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH] EXTENDED_HISTORY documentation typo MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.