You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
having recently updated zoxide, i receive a warning about a possible configuration issue.
Having seen the other issues, I assume this is due to the expansion of "$PROMPT_COMMAND" not including the zoxide hook.
In my case, this is not a misconfiguration. As I intentionally override PROMPT_COMMAND to be an array.
My initialization code (note that I've modularized my .bashrc:
# if `z` is installed, initiate it and set `cd` to `z`if! zoxide -V &>/dev/null;thenreturn 0;fi# HACK: Zoxide overwrites the PROMPT_COMMAND, so we must move it out of it's view, and restore it afterwards
OLD_PROMPT_COMMAND=("${PROMPT_COMMAND[@]}")
PROMPT_COMMAND=""# only overwrites PROMPT_COMMAND[0], but it doesn't matterexport _ZO_ECHO=0 # Fixes warning if set -ueval"$(zoxide init bash)"
PROMPT_COMMAND=("$PROMPT_COMMAND""${OLD_PROMPT_COMMAND[@]}") # prepend, since it's trying to prepend anywaysunset OLD_PROMPT_COMMAND
# Reuse cd completion if present (overwritten already), else default to directories
complete=$(complete -p cd2>/dev/null ||printf'%s 'complete -d cd)# remove ' cd' and replace with ' z'. Lack of quotes is intentional!if [ -n"$complete" ];theneval"${complete% cd} z"fialias cd='z'
I'd like to request that the _ZO_DOCTOR prompt checks that any element of ${PROMPT_COMMAND[@]} is the __zoxide_hook
Note:
>printf'%s\n'"${PROMPT_COMMAND[@]}"
__EXIT=$?
__zoxide_hook;
starship_precmd
history -a
(exit $__EXIT)
The text was updated successfully, but these errors were encountered:
Please note that in bash, arrays and scalars are (mostly) interchangeable.
If an array is expanded normally, it evaluates to the first element; if a scalar is treated as an array, it is an array of one element.
having recently updated zoxide, i receive a warning about a possible configuration issue.
Having seen the other issues, I assume this is due to the expansion of
"$PROMPT_COMMAND"
not including the zoxide hook.In my case, this is not a misconfiguration. As I intentionally override PROMPT_COMMAND to be an array.
My initialization code (note that I've modularized my
.bashrc
:I'd like to request that the
_ZO_DOCTOR
prompt checks that any element of${PROMPT_COMMAND[@]}
is the__zoxide_hook
Note:
The text was updated successfully, but these errors were encountered: