More _lp_jobcount_color refactoring
This commit is contained in:
parent
07d18d4ca3
commit
82425e51b0
14
liquidprompt
14
liquidprompt
@ -664,8 +664,6 @@ _lp_jobcount_color()
|
|||||||
{
|
{
|
||||||
[[ "$LP_ENABLE_JOBS" != 1 ]] && return
|
[[ "$LP_ENABLE_JOBS" != 1 ]] && return
|
||||||
|
|
||||||
local running=$(( $(jobs -r | wc -l) ))
|
|
||||||
local stopped=$(( $(jobs -s | wc -l) ))
|
|
||||||
local m_stop="z"
|
local m_stop="z"
|
||||||
local m_run="&"
|
local m_run="&"
|
||||||
local ret
|
local ret
|
||||||
@ -677,17 +675,19 @@ _lp_jobcount_color()
|
|||||||
(( detached > 0 )) && ret="${ret}${LP_COLOR_JOB_D}${detached}d${NO_COL}"
|
(( detached > 0 )) && ret="${ret}${LP_COLOR_JOB_D}${detached}d${NO_COL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $running != "0" ]] ; then
|
local running=$(( $(jobs -r | wc -l) ))
|
||||||
if [[ $ret != "" ]] ; then ret="${ret}/"; fi
|
if [[ $running != 0 ]] ; then
|
||||||
|
[[ -n "$ret" ]] && ret="${ret}/"
|
||||||
ret="${ret}${LP_COLOR_JOB_R}${running}${m_run}${NO_COL}"
|
ret="${ret}${LP_COLOR_JOB_R}${running}${m_run}${NO_COL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $stopped != "0" ]] ; then
|
local stopped=$(( $(jobs -s | wc -l) ))
|
||||||
if [[ $ret != "" ]] ; then ret="${ret}/"; fi
|
if [[ $stopped != 0 ]] ; then
|
||||||
|
[[ -n "$ret" ]] && ret="${ret}/"
|
||||||
ret="${ret}${LP_COLOR_JOB_Z}${stopped}${m_stop}${NO_COL}"
|
ret="${ret}${LP_COLOR_JOB_Z}${stopped}${m_stop}${NO_COL}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -ne "$ret"
|
echo -n "$ret"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user