summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2015-09-06 00:47:00 +0300
committerBen Hilburn <bhilburn@gmail.com>2015-09-06 00:47:00 +0300
commit7df9254c9fe46f75e7f2bb061a99aea81c2755be (patch)
treec3767d61148741766eb92daec30355b149258b5a /powerlevel9k.zsh-theme
parent6e4d24f50da4bacdaa56afb89b16472d6521697f (diff)
parentc72cfb155a7d486c69d6376c4e4383796c225ca3 (diff)
Merge pull request #86 from dritter/color_warning
Display a warning if the terminal supports less than 256 colors.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme8
1 files changed, 8 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 974273e7..abaaa983 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -676,6 +676,14 @@ build_right_prompt() {
}
powerlevel9k_init() {
+ # Display a warning, if the terminal does not support 256 colors
+ local term_colors
+ term_colors=$(tput colors)
+ if (( $term_colors < 256 )); then
+ print -P "%F{red}WARNING!%f Your terminal supports less than 256 colors!"
+ print "You should set TERM=xterm-256colors in your ~/.zshrc"
+ fi
+
setopt LOCAL_OPTIONS
unsetopt XTRACE KSH_ARRAYS
prompt_opts=(cr percent subst)