From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19572 invoked by alias); 6 Oct 2011 17:03:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16467 Received: (qmail 1534 invoked from network); 6 Oct 2011 17:03: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.5 required=5.0 tests=BAYES_00,DATE_IN_PAST_96_XX autolearn=no version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at benizi.com does not designate permitted sender hosts) Date: Sat, 1 Oct 2011 17:24:01 -0400 (EDT) From: "Benjamin R. Haskell" To: Jay Levitt cc: zsh-users@zsh.org Subject: Re: zshaddhistory confusion In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463810530-1992172371-1317504265=:10525" ---1463810530-1992172371-1317504265=:10525 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Sat, 1 Oct 2011, Jay Levitt wrote: > Benjamin Haskell wrote: >> zshaddhistory () { >>   print -sr -- "${1%%$'\n'}" >>   fc -p ~/.zsh_history_detail >>   print -sr -- "${1%%$'\n'} ### ${PWD} $(date '+%Y-%m-%d %R')" >>   return 1 >> } > > Thanks for the help! This fixes the double-write to > .zsh_history_detail, but is still writing weird stuff to .zsh_history: > > : 1317501595:0;echo autojump.zsh > : 1317501605:0;git st > : 1317501607:0;echo git st > : 1317501691:0;cd > : 1317501694:0;tail .zsh_history > By "weird stuff" I assume you mean the prefix? ': ' {timestamp} ':' {runtime} ';' That's controlled by the 'extended_history' option. You can turn it off via: setopt no_extended_history I love it (It provides half of what you're adding with your hook.), but I've also wanted to add PWD to my historyfiles for a while. -- Best, Ben ---1463810530-1992172371-1317504265=:10525--