From 34aec8b7993a52a6679b3cb78fda97630488976b Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 24 Nov 2026 11:44:09 -0800 Subject: [PATCH] docs(lib): note why the omz autoloads need -z under kshautoload The autoload files end with a call to the function they define. Under kshautoload, ksh-style loading would call it a second time; -z forces zsh-style loading so the trailing call is the only one. Co-Authored-By: Claude Opus 5.5 --- oh-my-zsh.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index b16a4f9da..e701e7cc3 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -78,7 +78,8 @@ fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath) # Load all stock functions (from $fpath files) called below. autoload -U compaudit compinit zrecompile -# The omz CLI and omz_diagnostic_dump are loaded on first use +# The omz CLI and omz_diagnostic_dump are loaded on first use; -z keeps +# zsh-style loading under kshautoload so the trailing call runs once autoload -Uz omz omz_diagnostic_dump is_plugin() {