mirror of
https://github.com/powerline/powerline.git
synced 2025-07-24 22:36:01 +02:00
parent
3df98fc276
commit
3c49ed1e96
@ -31,10 +31,26 @@ _powerline_return() {
|
||||
return $1
|
||||
}
|
||||
|
||||
_POWERLINE_HAS_PIPESTATUS=
|
||||
|
||||
_powerline_has_pipestatus() {
|
||||
if test -z "$_POWERLINE_HAS_PIPESTATUS" ; then
|
||||
_powerline_return 0 | _powerline_return 43
|
||||
if test "${PIPESTATUS[*]}" = "0 43" ; then
|
||||
_POWERLINE_HAS_PIPESTATUS=0
|
||||
else
|
||||
_POWERLINE_HAS_PIPESTATUS=1
|
||||
fi
|
||||
fi
|
||||
return $_POWERLINE_HAS_PIPESTATUS
|
||||
}
|
||||
|
||||
_powerline_status_wrapper() {
|
||||
local last_exit_code=$? last_pipe_status=( "${PIPESTATUS[@]}" )
|
||||
|
||||
if test "$last_exit_code" != "${last_pipe_status[-1]}" ; then
|
||||
if ! _powerline_has_pipestatus \
|
||||
|| test "${#last_pipe_status[@]}" -eq "0" \
|
||||
|| test "$last_exit_code" != "${last_pipe_status[-1]}" ; then
|
||||
last_pipe_status=()
|
||||
fi
|
||||
"$@" $last_exit_code "${last_pipe_status[*]}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user