2020-05-20 20:05:33 +03:00
|
|
|
function _tide_item_status
|
2021-03-02 20:46:40 +03:00
|
|
|
if string match --quiet --invert 0 $_tide_last_pipestatus # If there is a failure anywhere in the pipestatus
|
|
|
|
if test "$_tide_last_pipestatus" = 1 # If simple failure
|
2021-03-08 08:43:39 +03:00
|
|
|
if not contains prompt_char $tide_left_prompt_items
|
2020-07-09 04:37:47 +03:00
|
|
|
set -g tide_status_bg_color $tide_status_failure_bg_color
|
|
|
|
set_color $tide_status_failure_color
|
2021-03-02 20:46:40 +03:00
|
|
|
printf '%s' $tide_status_failure_icon' ' 1
|
2020-07-09 04:37:47 +03:00
|
|
|
end
|
2020-07-03 20:27:10 +03:00
|
|
|
else
|
2021-03-26 17:33:52 +03:00
|
|
|
if test $_tide_last_status = 0
|
2020-11-25 01:30:45 +03:00
|
|
|
set -g tide_status_bg_color $tide_status_success_bg_color
|
|
|
|
set_color $tide_status_success_color
|
|
|
|
printf '%s' $tide_status_success_icon' '
|
|
|
|
else
|
|
|
|
set -g tide_status_bg_color $tide_status_failure_bg_color
|
|
|
|
set_color $tide_status_failure_color
|
|
|
|
printf '%s' $tide_status_failure_icon' '
|
|
|
|
end
|
2020-07-03 20:27:10 +03:00
|
|
|
|
2021-03-02 20:52:58 +03:00
|
|
|
fish_status_to_signal $_tide_last_pipestatus | string replace SIG '' | string join '|'
|
2020-11-25 01:30:45 +03:00
|
|
|
end
|
2021-03-08 08:43:39 +03:00
|
|
|
else if not contains prompt_char $tide_left_prompt_items
|
2020-07-08 19:58:39 +03:00
|
|
|
set -g tide_status_bg_color $tide_status_success_bg_color
|
2020-07-03 20:27:10 +03:00
|
|
|
set_color $tide_status_success_color
|
|
|
|
printf '%s' $tide_status_success_icon
|
2020-05-13 22:46:42 +03:00
|
|
|
end
|
2021-03-02 20:46:40 +03:00
|
|
|
end
|