zsh-users
 help / color / mirror / code / Atom feed
* how to prevent writing to HISTFILE with custom zshaddhistory?
@ 2017-03-24  0:58 Timothee Cour
  2017-03-30 21:17 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Timothee Cour @ 2017-03-24  0:58 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

neither SHARE_HISTORY, INC_APPEND_HISTORY, INC_APPEND_HISTORY_TIME is good
enough in my use case so i want to do the work in zshaddhistory:

unsetopt SHARE_HISTORY

zshaddhistory(){
local COMMAND_STR=${1%%$'\n'}
print -r -- "$COMMAND_STR" >> $HISTFILE
# from http://zsh.sourceforge.net/Doc/Release/Functions.html to avoid
writing to $HISTFILE
return 2
}

but this results in duplicate entries to $HISTFILE

how do I prevent the automatic writing to $HISTFILE?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-30 21:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-24  0:58 how to prevent writing to HISTFILE with custom zshaddhistory? Timothee Cour
2017-03-30 21:17 ` Bart Schaefer

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).