diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-04-04 03:01:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-04 03:01:05 +0300 |
commit | 0e627164bc9da5574a72c95bc5be394cb26c3e00 (patch) | |
tree | ccd803fd94adc9a352a9c8b873abc22c165e7353 | |
parent | fa21d8fbc99c4a88334f877c686407dd27ac09a3 (diff) | |
parent | 9444e4c0c6d1d9949ec59710dbf1a0dc561b6670 (diff) |
Merge pull request #463 from liblit/handle-echotc-Co-failure
Gracefully handle `echotc Co` failure
-rwxr-xr-x | powerlevel9k.zsh-theme | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 52b56f4e..bbd1ec44 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1317,8 +1317,8 @@ prompt_powerlevel9k_setup() { # Display a warning if the terminal does not support 256 colors local term_colors - term_colors=$(echotc Co) - if (( $term_colors < 256 )); then + term_colors=$(echotc Co 2>/dev/null) + if (( ! $? && ${term_colors:-0} < 256 )); then print -P "%F{red}WARNING!%f Your terminal appears to support less than 256 colors!" print -P "If your terminal supports 256 colors, please export the appropriate environment variable" print -P "_before_ loading this theme in your \~\/.zshrc. In most terminal emulators, putting" |