From 35bc89946f102a0493898197182ae5bbb9e8a9a9 Mon Sep 17 00:00:00 2001 From: Grigorii Horos Date: Thu, 22 Jun 2023 13:21:42 +0300 Subject: [PATCH] Change $0 handler --- init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/init.sh b/init.sh index 55a9c95..892d186 100644 --- a/init.sh +++ b/init.sh @@ -24,7 +24,9 @@ if [[ -n ${BASH_VERSION} ]]; then ENHANCD_ROOT="$(builtin cd "$(command dirname "${BASH_SOURCE}")" && pwd)" elif [[ -n ${ZSH_VERSION} ]]; then # ZSH - ENHANCD_ROOT="${${(%):-%x}:A:h}" + 0="${ZERO:-${${0:#$ZSH_ARGZERO}:-${(%):-%N}}}" + 0="${${(M)0:#/*}:-$PWD/$0}" + ENHANCD_ROOT="${0:A:h}" compdef _cd __enhancd::cd fi