From 4db2eb0e1607e6b4d8097a5feb178f25357cb1c9 Mon Sep 17 00:00:00 2001 From: Justus Flerlage Date: Sat, 25 Nov 2017 01:43:30 +0100 Subject: [PATCH 1/4] Added flag for checking the term colors --- functions/colors.zsh | 4 ++++ powerlevel9k.zsh-theme | 1 + 2 files changed, 5 insertions(+) diff --git a/functions/colors.zsh b/functions/colors.zsh index 253de7cb..8029c727 100644 --- a/functions/colors.zsh +++ b/functions/colors.zsh @@ -7,6 +7,10 @@ ################################################################ function termColors() { + if [[ $POWERLEVEL9K_CHECK_TERM_COLORS == false ]]; then + return + fi + local term_colors if which tput &>/dev/null; then diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index d5b3ef75..50735886 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1563,6 +1563,7 @@ NEWLINE=' [[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT" } +set_default POWERLEVEL9K_CHECK_TERM_COLORS true prompt_powerlevel9k_setup() { # The value below was set to better support 32-bit CPUs. # It's the maximum _signed_ integer value on 32-bit CPUs. From 3a605c7f62437543dc76621a7de00796411da531 Mon Sep 17 00:00:00 2001 From: Justus Flerlage Date: Fri, 8 Dec 2017 00:41:33 +0100 Subject: [PATCH 2/4] renamed POWERLEVEL9K_CHECK_TERM_COLORS to POWERLEVEL9K_IGNORE_TERM_COLORS --- functions/colors.zsh | 2 +- powerlevel9k.zsh-theme | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/colors.zsh b/functions/colors.zsh index 8029c727..cf06ae43 100644 --- a/functions/colors.zsh +++ b/functions/colors.zsh @@ -7,7 +7,7 @@ ################################################################ function termColors() { - if [[ $POWERLEVEL9K_CHECK_TERM_COLORS == false ]]; then + if [[ $POWERLEVEL9K_IGNORE_TERM_COLORS == true ]]; then return fi diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 50735886..ef34be96 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -1563,7 +1563,7 @@ NEWLINE=' [[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT" } -set_default POWERLEVEL9K_CHECK_TERM_COLORS true +set_default POWERLEVEL9K_IGNORE_TERM_COLORS false prompt_powerlevel9k_setup() { # The value below was set to better support 32-bit CPUs. # It's the maximum _signed_ integer value on 32-bit CPUs. From f7aae86b78be0243c137a0e09a839f3c8406ff97 Mon Sep 17 00:00:00 2001 From: Justus Flerlage Date: Fri, 8 Dec 2017 01:00:55 +0100 Subject: [PATCH 3/4] added POWERLEVEL9K_IGNORE_TERM_LANG for disabling term_lang check --- powerlevel9k.zsh-theme | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index ef34be96..8488d9ac 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -12,7 +12,7 @@ # directory. For more detailed documentation, refer to the project wiki, hosted # on Github: https://github.com/bhilburn/powerlevel9k/wiki # -# There are a lot of easy ways you can customize your prompt segments and +# There aPOWERLEVEL9K_CHECK_TERM_COLORSre a lot of easy ways you can customize your prompt segments and # theming with simple variables defined in your `~/.zshrc`. ################################################################ @@ -1564,6 +1564,7 @@ NEWLINE=' } set_default POWERLEVEL9K_IGNORE_TERM_COLORS false +set_default POWERLEVEL9K_IGNORE_TERM_LANG false prompt_powerlevel9k_setup() { # The value below was set to better support 32-bit CPUs. # It's the maximum _signed_ integer value on 32-bit CPUs. @@ -1586,13 +1587,15 @@ prompt_powerlevel9k_setup() { termColors # 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." + if [[ $POWERLEVEL9K_IGNORE_TERM_LANG == false ]]; then + 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 fi defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs) From f994a7c3491487252070590b4e05ddaa17ef48f1 Mon Sep 17 00:00:00 2001 From: Ben Hilburn Date: Tue, 30 Jan 2018 16:41:34 -0500 Subject: [PATCH 4/4] Minor fix of copy/paste error --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 8488d9ac..45a4920e 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -12,7 +12,7 @@ # directory. For more detailed documentation, refer to the project wiki, hosted # on Github: https://github.com/bhilburn/powerlevel9k/wiki # -# There aPOWERLEVEL9K_CHECK_TERM_COLORSre a lot of easy ways you can customize your prompt segments and +# There are a lot of easy ways you can customize your prompt segments and # theming with simple variables defined in your `~/.zshrc`. ################################################################