Im using oh-my-zsh and there is a feature that is really annoying me. The history is share for each console. I want to disable that and after a review i found that
.oh-my-zsh/lib/history.zsh
has this:
setopt share_history # share command history data
How should I disable this? I mean, what is the RIGHT way. It is a lib not a plugin, if I edit the file I will not get updates for it.
enablehistory just unsets function set by previous alias. Show activity on this post. Try configuring your ZSH setup to run a postexec function that empties/deletes your .
You have to add DISABLE_AUTO_UPDATE="true" on your . zshrc before the source $ZSH/oh-my-zsh.sh line. By doing so, oh-my-zsh will just skip the update checking script.
This question is old but anyway:
As you can use setopt
for setting options, you can use unsetopt
to unset them.
Just add
unsetopt share_history
after having sourced $ZSH/oh-my-zsh.sh
(and yes, it's really annoying ;) )
I mean, what is the RIGHT way. It is a lib not a plugin, if I edit the file I will not get updates for it.
The accepted answer is the easiest way, but it bears mentioning that oh-my-zsh lets you override any file or plugin you want by putting it in $ZSH_CUSTOM
- even stuff in lib. If you want to do more than just unsetopt share_history
you could run this:
# $ZSH_CUSTOM should already be automatically set to $ZSH/custom # but you can customize the location in your ~.zshrc. # ie: export ZSH_CUSTOM=~/.zsh_custom # set up lib in omz custom area mkdir -p $ZSH_CUSTOM/lib # start off with omz version of the file cp $ZSH/lib/history.zsh $ZSH_CUSTOM/lib/history.zsh # edit that file and make it what you want ${EDITOR:-vim} $ZSH_CUSTOM/lib/history.zsh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With