Skip to content

Commit

Permalink
Alternate approach to appending to PROMPT_COMMAND
Browse files Browse the repository at this point in the history
Seems to work well no matter what weirdness is already in
PROMPT_COMMAND.

Thanks @godlygeek. Closes #99
  • Loading branch information
rupa committed Jun 24, 2013
1 parent 66b9ab6 commit ea574b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion z.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ea574b7

Please sign in to comment.