aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-07-07 20:51:26 +0300
committerBen Hilburn <bhilburn@gmail.com>2016-07-07 20:51:26 +0300
commit4666bd49e631cf61befd959c55e2a83a5b87a932 (patch)
tree9517aae2cb74e55e19616661f303d2e0df42f914 /powerlevel9k.zsh-theme
parent1c9ec53d58c4c5ee4c3b091e23bd0faa07dbc19e (diff)
Now printing a warning if $LANG is set incorrectly.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme12
1 files changed, 11 insertions, 1 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 8fa623a1..2b4f0dbd 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1052,13 +1052,23 @@ powerlevel9k_init() {
# Display a warning if the terminal does not support 256 colors
local term_colors
term_colors=$(echotc Co)
- if (( term_colors < 256 )); then
+ if (( $term_colors < 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"
print -P "%F{blue}export TERM=\"xterm-256color\"%f at the top of your \~\/.zshrc is sufficient."
fi
+ # If the terminal `LANG` is set to `C`, this theme will not work at all.
+ local term_lang
+ term_lang=$(echo $LANG)
+ if [[ $term_lang == 'C' ]]; then
+ print -P "\t%F{red}WARNING!%f Your terminal's 'LANG' is set to 'C', which breaks this theme!"
+ print -P "\t%F{red}WARNING!%f Please set your 'LANG' to a UTF-8 language, like 'en_US.UTF-8'"
+ print -P "\t%F{red}WARNING!%f _before_ loading this theme in your \~\.zshrc. Putting"
+ print -P "\t%F{red}WARNING!%f %F{blue}export LANG=\"en_US.UTF-8\"%f at the top of your \~\/.zshrc is sufficient."
+ fi
+
# Display a warning if deprecated segments are in use.
typeset -AH deprecated_segments
# old => new