fi
# Simulate hooks using _functions arrays for Zsh versions older than 4.3.4. At
-# the moment only precmd() and preexec() are simulated.
+# the moment only precmd(), preexec() and chpwd() are simulated.
#
# At least 4.3.4 (not sure about later versions) has an error in add-zsh-hook
# so the compatibility version is used there too.
# Provide add-zsh-hook which was added in 4.3.4.
fpath=(~/.zsh/functions/compatibility $fpath)
- # Run all functions defined in the ${precmd,preexec}_functions arrays.
+ # Run all functions defined in the ${precmd,preexec,chpwd}_functions
+ # arrays.
function precmd() {
for function in $precmd_functions; do
$function $@
$function $@
done
}
+ function chpwd() {
+ for function in $chpwd_functions; do
+ $function $@
+ done
+ }
fi
# Autoload add-zsh-hook to add/remove zsh hook functions easily.