mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-12 19:18:28 +02:00
Merge pull request #86 from dritter/color_warning
Display a warning if the terminal supports less than 256 colors.
This commit is contained in:
commit
7df9254c9f
@ -676,6 +676,14 @@ build_right_prompt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
powerlevel9k_init() {
|
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
|
setopt LOCAL_OPTIONS
|
||||||
unsetopt XTRACE KSH_ARRAYS
|
unsetopt XTRACE KSH_ARRAYS
|
||||||
prompt_opts=(cr percent subst)
|
prompt_opts=(cr percent subst)
|
||||||
|
Loading…
Reference in New Issue
Block a user