Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zshaddhistory confusion
- X-seq: zsh-users 16467
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: Jay Levitt <jay.levitt@xxxxxxxxx>
- Subject: Re: zshaddhistory confusion
- Date: Sat, 1 Oct 2011 17:24:01 -0400 (EDT)
- Cc: zsh-users@xxxxxxx
- In-reply-to: <CANSg5moWB0XQr3gQ4stoOacgK50=YaKZtv+kmhBwGDOfK9zXVA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CANSg5mq_7ntWK6XmAih9H0Lx1qUh0fcKARHJhSXwp-4zREXJjA@mail.gmail.com> <alpine.LNX.2.01.1109261658500.10525@hp.internal> <CANSg5moWB0XQr3gQ4stoOacgK50=YaKZtv+kmhBwGDOfK9zXVA@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author