Merge branch 'fix/zsh-grep-alias'
This commit is contained in:
commit
baadcd7af7
16
liquidprompt
16
liquidprompt
@ -134,9 +134,9 @@ esac
|
|||||||
|
|
||||||
# Get cpu count
|
# Get cpu count
|
||||||
case "$LP_OS" in
|
case "$LP_OS" in
|
||||||
Linux) _lp_CPUNUM=$( nproc 2>/dev/null || grep -c '^[Pp]rocessor' /proc/cpuinfo ) ;;
|
Linux) _lp_CPUNUM=$( nproc 2>/dev/null || \grep -c '^[Pp]rocessor' /proc/cpuinfo ) ;;
|
||||||
FreeBSD|Darwin|OpenBSD) _lp_CPUNUM=$( sysctl -n hw.ncpu ) ;;
|
FreeBSD|Darwin|OpenBSD) _lp_CPUNUM=$( sysctl -n hw.ncpu ) ;;
|
||||||
SunOS) _lp_CPUNUM=$( kstat -m cpu_info | grep -c "module: cpu_info" ) ;;
|
SunOS) _lp_CPUNUM=$( kstat -m cpu_info | \grep -c "module: cpu_info" ) ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Extended regexp patterns for sed
|
# Extended regexp patterns for sed
|
||||||
@ -679,8 +679,8 @@ _lp_jobcount_color()
|
|||||||
|
|
||||||
if $_LP_ENABLE_DETACHED_SESSIONS; then
|
if $_LP_ENABLE_DETACHED_SESSIONS; then
|
||||||
local -i detached=0
|
local -i detached=0
|
||||||
$_LP_ENABLE_SCREEN && let detached=$(screen -ls 2> /dev/null | grep -c '[Dd]etach[^)]*)$')
|
$_LP_ENABLE_SCREEN && let detached=$(screen -ls 2> /dev/null | \grep -c '[Dd]etach[^)]*)$')
|
||||||
$_LP_ENABLE_TMUX && let detached+=$(tmux list-sessions 2> /dev/null | grep -cv 'attached')
|
$_LP_ENABLE_TMUX && let detached+=$(tmux list-sessions 2> /dev/null | \grep -cv 'attached')
|
||||||
(( 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
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ _lp_git_branch_color()
|
|||||||
|
|
||||||
local end
|
local end
|
||||||
end="$NO_COL"
|
end="$NO_COL"
|
||||||
if LC_ALL=C \git status --porcelain 2>/dev/null | grep -Eq '^\?\?'; then
|
if LC_ALL=C \git status --porcelain 2>/dev/null | \grep -Eq '^\?\?'; then
|
||||||
end="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED$end"
|
end="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED$end"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -869,7 +869,7 @@ _lp_hg_branch_color()
|
|||||||
|
|
||||||
local has_untracked
|
local has_untracked
|
||||||
has_untracked=
|
has_untracked=
|
||||||
if hg status -u 2>/dev/null | grep -q '^\?' >/dev/null ; then
|
if hg status -u 2>/dev/null | \grep -q '^\?' >/dev/null ; then
|
||||||
has_untracked="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED"
|
has_untracked="$LP_COLOR_CHANGES$LP_MARK_UNTRACKED"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -878,7 +878,7 @@ _lp_hg_branch_color()
|
|||||||
# Unfortunately this requires contacting the remote, so this is always slow
|
# Unfortunately this requires contacting the remote, so this is always slow
|
||||||
# => disabled https://github.com/nojhan/liquidprompt/issues/217
|
# => disabled https://github.com/nojhan/liquidprompt/issues/217
|
||||||
local -i commits
|
local -i commits
|
||||||
#commits=$(hg outgoing --no-merges ${branch} 2>/dev/null | grep -c '\(^changeset\:\)')
|
#commits=$(hg outgoing --no-merges ${branch} 2>/dev/null | \grep -c '\(^changeset\:\)')
|
||||||
commits=0
|
commits=0
|
||||||
|
|
||||||
# Check if there is some uncommitted stuff
|
# Check if there is some uncommitted stuff
|
||||||
@ -947,7 +947,7 @@ _lp_svn_branch_color()
|
|||||||
branch="$(_lp_svn_branch)"
|
branch="$(_lp_svn_branch)"
|
||||||
if [[ -n "$branch" ]] ; then
|
if [[ -n "$branch" ]] ; then
|
||||||
local changes
|
local changes
|
||||||
changes=$(( $(svn status $LP_SVN_STATUS_OPTIONS | grep -c -v "?") ))
|
changes=$(( $(svn status $LP_SVN_STATUS_OPTIONS | \grep -c -v "?") ))
|
||||||
if [[ $changes -eq 0 ]] ; then
|
if [[ $changes -eq 0 ]] ; then
|
||||||
echo "${LP_COLOR_UP}${branch}${NO_COL}"
|
echo "${LP_COLOR_UP}${branch}${NO_COL}"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user