zsh-users
 help / color / mirror / code / Atom feed
From: "Benjamin R. Haskell" <zsh@benizi.com>
To: Jay Levitt <jay.levitt@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: zshaddhistory confusion
Date: Sat, 1 Oct 2011 17:24:01 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.01.1110011712360.10525@hp.internal> (raw)
In-Reply-To: <CANSg5moWB0XQr3gQ4stoOacgK50=YaKZtv+kmhBwGDOfK9zXVA@mail.gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 858 bytes --]

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

  reply	other threads:[~2011-10-06 17:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 17:11 Jay Levitt
2011-09-27  3:01 ` Benjamin R. Haskell
2011-09-27 14:17   ` Bart Schaefer
2011-09-28  4:11     ` Benjamin R. Haskell
2011-10-01 20:44   ` Jay Levitt
2011-10-01 21:24     ` Benjamin R. Haskell [this message]
2011-10-02  0:21     ` Geoff Wing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1110011712360.10525@hp.internal \
    --to=zsh@benizi.com \
    --cc=jay.levitt@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).