Alternate approach to appending to PROMPT_COMMAND
Seems to work well no matter what weirdness is already in PROMPT_COMMAND. Thanks @godlygeek. Closes #99
This commit is contained in:
1 parent
66b9ab69c1
commit
ea574b79df
1 file changed
+1
-1
@@ -230,7 +230,7 @@ elif complete &> /dev/null; then
|
||||
[ "$_Z_NO_PROMPT_COMMAND" ] || {
|
||||
# bash populate directory list. avoid clobbering other PROMPT_COMMANDs.
|
||||
grep -q "_z --add" <<< "$PROMPT_COMMAND" || {
|
||||
PROMPT_COMMAND="${PROMPT_COMMAND%;}${PROMPT_COMMAND:+;}"'_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
|
||||
PROMPT_COMMAND="$PROMPT_COMMAND"$'\n''_z --add "$(pwd '$_Z_RESOLVE_SYMLINKS' 2>/dev/null)" 2>/dev/null;'
|
||||
}
|
||||
}
|
||||
fi
|
||||
Reference in new issue
Block a user