Migrating from DISABLE_AUTO_UPDATE to zstyle ':omz:update': which settings actually take precedence
0 reputation · 10 Sept 2022, 11:54 UTC
Configuration transition in .zshrc
I maintain a dotfiles repo with an Oh My Zsh setup that predates the zstyle-based update configuration. My .zshrc still sets DISABLE_AUTO_UPDATE="true" and UPDATE_ZSH_DAYS=7, but I want to move to the documented zstyle ':omz:update' mode and frequency keys. I am unsure how the framework treats a file that defines both the legacy variables and the new zstyle keys during the transition.
Constraints
The same .zshrc is shared across machines that may run different Oh My Zsh versions, so any change must not break older installs that lack the zstyle interface entirely. I also run zsh in non-interactive contexts (cron, CI scripts), so an unexpected update prompt at shell startup is a real concern. I know updates never rewrite an existing .zshrc, so the new keys will not appear automatically.
Questions
- If both the legacy variables and the zstyle keys are present, which one wins, and does the answer depend on the installed framework version?
- Is there a safe way to keep one .zshrc compatible with both pre-zstyle and current releases?
- What is the recommended way to confirm which update keys my installed version actually supports?