From 86b443cffcd74d8dce0570792f1647491ffe5974 Mon Sep 17 00:00:00 2001 From: Ajeet D'Souza <98ajeet@gmail.com> Date: Sat, 3 Oct 2026 17:49:39 +0530 Subject: [PATCH] Define __zoxide_doctor for all hooks in POSIX init (#1317) --- templates/posix.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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. #