diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index caffd2a0..ed6046b1 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -189,7 +189,7 @@ function psu { function cdx { local exe="$1" local fqe="$(command -v $exe 2>/dev/null)" - local dir="$(dirname $fqe 2>/dev/null)" + local dir="${commands[$exe]:h}" if [[ ! -x "$fqe" ]]; then echo "cdx: '$exe' not found."