diff --git a/templates/posix.txt b/templates/posix.txt index 7c48f27..d0e917c 100644 --- a/templates/posix.txt +++ b/templates/posix.txt @@ -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. #