diff options
author | AdrienHorgnies <adrien.pierre.horgnies@gmail.com> | 2017-07-15 22:28:27 +0300 |
---|---|---|
committer | AdrienHorgnies <adrien.pierre.horgnies@gmail.com> | 2017-07-15 22:28:27 +0300 |
commit | a4f1ce990b219b4ce66018aa59a72b3c24b69dd9 (patch) | |
tree | 7fb845ef6cbb90d6349d6a2c15fa1f69e335d047 /powerlevel9k.zsh-theme | |
parent | c69d45cdcce1f0d0542673be23b7c524eb83870d (diff) |
change status segment option set
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-x | powerlevel9k.zsh-theme | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index b08155ed..73682f38 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1087,9 +1087,13 @@ prompt_ssh() { fi } -# Status: return code if verbose, otherwise just an icon if an error occurred +# old options, retro compatibility set_default POWERLEVEL9K_STATUS_VERBOSE true set_default POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE false +# Status: When an error occur, return the error code, or a cross icon if option is set +# Display an ok icon when no error occur, or hide the segment if option is set to false +set_default POWERLEVEL9K_STATUS_CROSS false +set_default POWERLEVEL9K_STATUS_OK true set_default POWERLEVEL9K_STATUS_SHOW_PIPESTATUS true prompt_status() { local ec_text @@ -1112,12 +1116,12 @@ prompt_status() { fi if (( ec_sum > 0 )); then - if [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then + if [[ "$POWERLEVEL9K_STATUS_CROSS" == false && "$POWERLEVEL9K_STATUS_VERBOSE" == true ]]; then "$1_prompt_segment" "$0_ERROR" "$2" "red" "226" "$ec_text" 'CARRIAGE_RETURN_ICON' else "$1_prompt_segment" "$0_ERROR" "$2" "$DEFAULT_COLOR" "red" "" 'FAIL_ICON' fi - elif [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true || "$POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE" == true ]]; then + elif [[ "$POWERLEVEL9K_STATUS_OK" == true ]] && [[ "$POWERLEVEL9K_STATUS_VERBOSE" == true || "$POWERLEVEL9K_STATUS_OK_IN_NON_VERBOSE" == true ]]; then "$1_prompt_segment" "$0_OK" "$2" "$DEFAULT_COLOR" "green" "" 'OK_ICON' fi } |