This commit is contained in:
Sandro 2025-10-06 16:15:32 -07:00 committed by GitHub
commit 702125989c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -55,7 +55,11 @@ function __zoxide_hook() {
# Initialize hook.
if [[ ${PROMPT_COMMAND:=} != *'__zoxide_hook'* ]]; then
PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}"
if [[ "$(declare -p PROMPT_COMMAND 2>&1)" == "declare -a"* ]]; then
PROMPT_COMMAND=(__zoxide_hook "${PROMPT_COMMAND[@]}")
else
PROMPT_COMMAND="__zoxide_hook;${PROMPT_COMMAND#;}"
fi
fi
{%- endif %}