Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
how to prevent writing to HISTFILE with custom zshaddhistory?
- X-seq: zsh-users 22604
- From: Timothee Cour <timothee.cour2@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: how to prevent writing to HISTFILE with custom zshaddhistory?
- Date: Thu, 23 Mar 2017 17:58:56 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9MzDXRIrREME98flwTcP+ClTG+L7k1C5oqW23GNo3kk=; b=j+OEpmh3KKrE2F0M1vJIbMLxG390t+GrbujWSKUkotdsg7t1p/T/8dMLPWFKvT5U7b iH0t2Z2Edhpn24mhBgOKeUuA9zcQDeyFmfps0gmp920buOslX8i6dkNUbRpYHZR1qDkq LOP9diN658lvNtHpcdQ8sSIFi/A3rnTrtI1waylU4m0Md8FwIpx9giJnQS87wTBgSqlk lEzSldTsfnDJaAfBxzDWRVFYG9PeOC5lx5yEZX+kjD+r26IFqXYmjwr8AaNYTO+GoVkL 6IA+cHwBKuBRHXBUVvYQVBLKIkKONOw/PxBKcwOVftD/SbGklbrhxj1wBWmCPq4wnV6u O5bA==
- 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
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?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author