optimisation: use built-in time vars \t and %*
This commit is contained in:
parent
5b247e3d82
commit
33dc6547d7
@ -53,12 +53,14 @@ if test -n "$BASH_VERSION" -a -n "$PS1" -a -n "$TERM" ; then
|
|||||||
_LP_CLOSE_ESC="\]"
|
_LP_CLOSE_ESC="\]"
|
||||||
_LP_USER_SYMBOL="\u"
|
_LP_USER_SYMBOL="\u"
|
||||||
_LP_HOST_SYMBOL="\h"
|
_LP_HOST_SYMBOL="\h"
|
||||||
|
_LP_TIME_SYMBOL="\\\\t"
|
||||||
elif test -n "$ZSH_VERSION" ; then
|
elif test -n "$ZSH_VERSION" ; then
|
||||||
_LP_WORKING_SHELL=zsh
|
_LP_WORKING_SHELL=zsh
|
||||||
_LP_OPEN_ESC="%{"
|
_LP_OPEN_ESC="%{"
|
||||||
_LP_CLOSE_ESC="%}"
|
_LP_CLOSE_ESC="%}"
|
||||||
_LP_USER_SYMBOL="%n"
|
_LP_USER_SYMBOL="%n"
|
||||||
_LP_HOST_SYMBOL="%m"
|
_LP_HOST_SYMBOL="%m"
|
||||||
|
_LP_TIME_SYMBOL="%*"
|
||||||
else
|
else
|
||||||
echo "liquidprompt: shell not supported" >&2
|
echo "liquidprompt: shell not supported" >&2
|
||||||
return
|
return
|
||||||
@ -1182,7 +1184,7 @@ _lp_sb()
|
|||||||
_lp_time()
|
_lp_time()
|
||||||
{
|
{
|
||||||
[[ "$LP_ENABLE_TIME" != 1 ]] && return
|
[[ "$LP_ENABLE_TIME" != 1 ]] && return
|
||||||
echo -ne "${LP_COLOR_TIME}$(date +%H:%M:%S)${NO_COL}"
|
echo -ne "${LP_COLOR_TIME}${_LP_TIME_SYMBOL}${NO_COL}"
|
||||||
}
|
}
|
||||||
|
|
||||||
########################
|
########################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user