-
Notifications
You must be signed in to change notification settings - Fork 642
Open
Description
New Bash versions prefer for PROMPT_COMMAND
to be an array, for example:
PROMPT_COMMAND=(cmd1 cmd2 cmd3)
instead of legacy
PROMPT_COMMAND='cmd1; cmd2; cmd3'
However, zoxide always seems to do something like:
PROMPT_COMMAND="__zoxide_hook;$PROMPT_COMMAND"
which is fine because it works no matter if PROMPT_COMMAND
is a regular variable or an array, but if it is an array, it results in an ugly array like so:
$ printf '%s\n' "${PROMPT_COMMAND[@]}"
__zoxide_hook;cmd1
cmd2
cmd3
I suggest detecting if PROMPT_COMMAND
has more than 1 array element, and in that case do something like:
PROMPT_COMMAND=(__zoxide_hook "${PROMPT_COMMAND[@]}")
to prepend it to the array nicely.
Metadata
Metadata
Assignees
Labels
No labels