fix building wrong PROMPT_COMMAND

If one previously declared a perfectly valid `PROMPT_COMMAND` like `PROMPT_COMMAND="do_something;"`, *byobu* would have corrupted it: `PROMPT_COMMAND="$PROMPT_COMMAND;history -a;history -r"` resulted in `"do_something;;history -a;history -r"`, and the double semicolons are illegal: `bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;'`
This commit is contained in:
Christian Mäder 2013-04-29 11:49:04 +03:00
commit dcacf620ab

View file

@ -58,7 +58,7 @@ elif [ "$BYOBU_SOURCED_PROFILE" != "1" ] && [ "$LC_BYOBU" != "0" ] && [ "$BYOBU_
esac
fi
done
[ -n "$PROMPT_COMMAND" ] && PROMPT_COMMAND="$PROMPT_COMMAND;history -a;history -r" || PROMPT_COMMAND="history -a;history -r"
PROMPT_COMMAND="history -a;history -r;$PROMPT_COMMAND"
# Source profile, if necessary
[ -z "$_byobu_sourced" ] && [ -r "$HOME/.profile" ] && . "$HOME/.profile"
if byobu-launcher; then