Oh My Zsh - Disable 'Would you like to check for updates' prompt
Set environment variable DISABLE_UPDATE_PROMPT=true
to always reply Yes and automatically upgrade.
Set environment variable DISABLE_AUTO_UPDATE=true
to always reply No and never upgrade.
Simply add one of these in your ~/.zshrc
somewhere before calling source $ZSH/oh-my-zsh.sh
.
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.
Deprecation in some other answers
Other answers might reference deprecated method for updating the settings.
As per OhMyZsh wiki, there is a section talking about Deprecated settings
.
These settings are still supported but will be removed in a future version of Oh My Zsh. Migrate to the
zstyle
settings while you still can.
For example, the following two methods achieve the same result:
A. Deprecated method for modifying Settings (Environment Variable in .zshrc
)
DISABLE_AUTO_UPDATE=true
B. Recommended method for modifying Settings (zstyle
Setting)
zstyle ':omz:update' mode disabled
I'm surprised no one mentioned the new and fine-tuned controls over OhMyZsh updates, that deprecates the old method.
This of course does not prevent you from invoking zstyle
from .zshrc
.
You can try the following commands that are stated by OMZ docs:
OMZ Docs -- Getting Updates
You have several options to tweak OMZ updates.
-
By default, you will be prompted to check for updates every 2 weeks. You can choose other update modes by adding a line to your ~/.zshrc file, before Oh My Zsh is loaded:
-
Automatic update without confirmation prompt:
zstyle ':omz:update' mode auto
- Just offer a reminder every few days, if there are updates available:
zstyle ':omz:update' mode reminder
- To disable automatic updates entirely:
zstyle ':omz:update' mode disabled
- NOTE: you can control how often Oh My Zsh checks for updates with the following setting:
# This will check for updates every 7 days
zstyle ':omz:update' frequency 7
# This will check for updates every time you open the terminal (not recommended)
zstyle ':omz:update' frequency 0
IMPORTANT (zstyle
precondition)
- Do note, the commands above (
zstyle
) have to be executed strictly from within an OhMyZsh shell. - In other words, after installing ZSH and OhMyZsh, maybe you decided not to change your default shell to ZSH.
- In that particular case, you have to switch your shell temporarily to ZSH for the above commands to work. You can do that with
exec /bin/zsh
, this probably applies to.zshrc
as well.
Understanding zstyle
- WARNING: This is a potential rabbit hole :)
- Online documentation
- man pages:
man zshmodules
- Check out some insightful answers in this question.