Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zshaddhistory confusion



In addition to my normal zsh history, I want to write to a
.zsh_history_detail file with comments showing date, pwd, etc.  I'm
trying

function zshaddhistory() {
    print -sr -- ${1%%\n'}
    fc -p .zsh_history_detail
    print -sr "${1%%\n'} ### ${PWD} `date '+%Y-%m-%d %R'`"
}

but it now
  1. writes what looks like a pid into .zsh_history, and
  2. puts both the normal AND the detailed history into .zsh_history_detail.

I am probably misunderstanding the fairly terse zshaddhistory docs.  Any hints?



Messages sorted by: Reverse Date, Date, Thread, Author