diff --git a/z.lua b/z.lua index 6e48d0e..a70fe13 100755 --- a/z.lua +++ b/z.lua @@ -2215,11 +2215,13 @@ _zlua() { local zdest=$("$ZLUA_LUAEXE" "$ZLUA_SCRIPT" --cd $arg_type $arg_subdir $arg_inter "$@") if [ -n "$zdest" ] && [ -d "$zdest" ]; then if [ -z "$_ZL_CD" ]; then - builtin cd "$zdest" + builtin cd "$zdest" || return 1 else - $_ZL_CD "$zdest" + $_ZL_CD "$zdest" || return 1 fi if [ -n "$_ZL_ECHO" ]; then pwd; fi + else + return 1 fi fi }