bugfix: avoid recurisve prompt command

The bug was occuring when sourcing the liquidprompt a second time while it has
already been set. A set variable is now set to avoid double sourcing.
This commit is contained in:
nojhan 2012-08-07 21:29:44 +02:00
parent 5da885a4ab
commit fb814125af

View File

@ -768,9 +768,16 @@ __set_bash_prompt()
# Activate the liquid prompt
prompt_on()
{
LP_OLD_PS1="$PS1"
LP_OLD_PROMPT_COMMAND="$PROMPT_COMMAND"
# if liquidprompt has not been already set
if [[ -z "$LP_LIQUIDPROMPT" ]] ; then
LP_OLD_PS1="$PS1"
LP_OLD_PROMPT_COMMAND="$PROMPT_COMMAND"
fi
PROMPT_COMMAND=__set_bash_prompt
# Keep in mind that LP has been sourced
# (to avoid recursive prompt command).
LP_LIQUIDPROMPT=1
}
# Come back to the old prompt