1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-23 12:40:08 +00:00

Merge pull request #463 from liblit/handle-echotc-Co-failure

Gracefully handle `echotc Co` failure
This commit is contained in:
Ben Hilburn 2017-04-03 20:01:05 -04:00 committed by GitHub
commit 0e627164bc

View file

@ -1317,8 +1317,8 @@ prompt_powerlevel9k_setup() {
# Display a warning if the terminal does not support 256 colors # Display a warning if the terminal does not support 256 colors
local term_colors local term_colors
term_colors=$(echotc Co) term_colors=$(echotc Co 2>/dev/null)
if (( $term_colors < 256 )); then if (( ! $? && ${term_colors:-0} < 256 )); then
print -P "%F{red}WARNING!%f Your terminal appears to support less than 256 colors!" 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 "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" print -P "_before_ loading this theme in your \~\/.zshrc. In most terminal emulators, putting"