Cleanup previous commit about LP_PATH_DEFAULT

- avoid overriding the existing LP_PATH_DEFAULT from the environment
- use the _LP_*_SYMBOL convention for shell dependent default values
This commit is contained in:
Olivier Mengué 2013-12-17 21:39:48 +01:00
parent eb0119a08f
commit 455da0d4fa

View File

@ -67,7 +67,7 @@ if test -n "$BASH_VERSION" -a -n "$PS1" -a -n "$TERM" ; then
_LP_TIME_SYMBOL="\t"
_LP_MARK_SYMBOL='\$'
_LP_FIRST_INDEX=0
LP_PATH_DEFAULT="\\w"
_LP_PWD_SYMBOL="\\w"
elif test -n "$ZSH_VERSION" ; then
_LP_SHELL_bash=false
_LP_SHELL_zsh=true
@ -78,7 +78,7 @@ elif test -n "$ZSH_VERSION" ; then
_LP_TIME_SYMBOL="%*"
_LP_MARK_SYMBOL='%(!.#.%%)'
_LP_FIRST_INDEX=1
LP_PATH_DEFAULT="%~"
_LP_PWD_SYMBOL="%~"
else
echo "liquidprompt: shell not supported" >&2
return
@ -212,6 +212,7 @@ _lp_source_config()
LP_RUNTIME_THRESHOLD=${LP_RUNTIME_THRESHOLD:-2}
LP_PATH_LENGTH=${LP_PATH_LENGTH:-35}
LP_PATH_KEEP=${LP_PATH_KEEP:-2}
LP_PATH_DEFAULT="${LP_PATH_DEFAULT:-$_LP_PWD_SYMBOL}"
LP_HOSTNAME_ALWAYS=${LP_HOSTNAME_ALWAYS:-0}
LP_USER_ALWAYS=${LP_USER_ALWAYS:-1}
LP_PERCENTS_ALWAYS=${LP_PERCENTS_ALWAYS:-1}
@ -222,7 +223,6 @@ _lp_source_config()
LP_TITLE_CLOSE=${LP_TITLE_CLOSE:-"\a"}
LP_SCREEN_TITLE_OPEN=${LP_SCREEN_TITLE_OPEN:-"\033k"}
LP_SCREEN_TITLE_CLOSE=${LP_SCREEN_TITLE_CLOSE:-"\033\134"}
LP_PATH_DEFAULT=${LP_PATH_DEFAULT:-$LP_PATH_DEFAULT}
LP_ENABLE_PERM=${LP_ENABLE_PERM:-1}
LP_ENABLE_SHORTEN_PATH=${LP_ENABLE_SHORTEN_PATH:-1}