Jay Levitt
2011-09-26 17:11:15 UTC
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?
.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?