mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-25 05:30:06 +00:00
Merge pull request #681 from Stazer/tcolor-warning
Added flag to ignore checking the term colors & lang settings
This commit is contained in:
commit
fd3d234354
2 changed files with 15 additions and 7 deletions
|
@ -7,6 +7,10 @@
|
||||||
################################################################
|
################################################################
|
||||||
|
|
||||||
function termColors() {
|
function termColors() {
|
||||||
|
if [[ $POWERLEVEL9K_IGNORE_TERM_COLORS == true ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
local term_colors
|
local term_colors
|
||||||
|
|
||||||
if which tput &>/dev/null; then
|
if which tput &>/dev/null; then
|
||||||
|
|
|
@ -1625,6 +1625,8 @@ NEWLINE='
|
||||||
[[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT"
|
[[ $POWERLEVEL9K_PROMPT_ADD_NEWLINE == true ]] && PROMPT="$NEWLINE$PROMPT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_default POWERLEVEL9K_IGNORE_TERM_COLORS false
|
||||||
|
set_default POWERLEVEL9K_IGNORE_TERM_LANG false
|
||||||
prompt_powerlevel9k_setup() {
|
prompt_powerlevel9k_setup() {
|
||||||
# The value below was set to better support 32-bit CPUs.
|
# The value below was set to better support 32-bit CPUs.
|
||||||
# It's the maximum _signed_ integer value on 32-bit CPUs.
|
# It's the maximum _signed_ integer value on 32-bit CPUs.
|
||||||
|
@ -1647,13 +1649,15 @@ prompt_powerlevel9k_setup() {
|
||||||
termColors
|
termColors
|
||||||
|
|
||||||
# If the terminal `LANG` is set to `C`, this theme will not work at all.
|
# If the terminal `LANG` is set to `C`, this theme will not work at all.
|
||||||
local term_lang
|
if [[ $POWERLEVEL9K_IGNORE_TERM_LANG == false ]]; then
|
||||||
term_lang=$(echo $LANG)
|
local term_lang
|
||||||
if [[ $term_lang == 'C' ]]; then
|
term_lang=$(echo $LANG)
|
||||||
print -P "\t%F{red}WARNING!%f Your terminal's 'LANG' is set to 'C', which breaks this theme!"
|
if [[ $term_lang == 'C' ]]; then
|
||||||
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 Your terminal's 'LANG' is set to 'C', which breaks this theme!"
|
||||||
print -P "\t%F{red}WARNING!%f _before_ loading this theme in your \~\.zshrc. Putting"
|
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 %F{blue}export LANG=\"en_US.UTF-8\"%f at the top of your \~\/.zshrc is sufficient."
|
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
|
fi
|
||||||
|
|
||||||
defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
|
defined POWERLEVEL9K_LEFT_PROMPT_ELEMENTS || POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir rbenv vcs)
|
||||||
|
|
Loading…
Reference in a new issue