Define __zoxide_doctor for all hooks in POSIX init (#1317)

This commit is contained in:
Ajeet D'Souza
2026-10-03 17:49:39 +05:30
committed by GitHub
parent c479cc8294
commit 86b443cffc
+7 -7
View File
@@ -56,6 +56,13 @@ if [ "${PS1:=}" = "${PS1#*\$(__zoxide_hook)}" ]; then
PS1="${PS1}\$(__zoxide_hook)"
fi
{%- when InitHook::Pwd -%}
\command printf "%s\n%s\n" \
"zoxide: PWD hooks are not supported on POSIX shells." \
" Use 'zoxide init posix --hook prompt' instead."
{%- endmatch %}
# Report common issues.
__zoxide_doctor() {
{%- if hook != InitHook::Prompt %}
@@ -80,13 +87,6 @@ __zoxide_doctor() {
{%- endif %}
}
{%- when InitHook::Pwd -%}
\command printf "%s\n%s\n" \
"zoxide: PWD hooks are not supported on POSIX shells." \
" Use 'zoxide init posix --hook prompt' instead."
{%- endmatch %}
{{ section }}
# When using zoxide with --no-cmd, alias these internal functions as desired.
#