1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-21 23:01:57 +00:00

correctly handle zsh 5.4.2 whose ZSH_PATCHLEVEL does not start with "zsh"

This commit is contained in:
romkatv 2019-05-30 10:46:08 +02:00
parent ecb5c098a2
commit 4dad2d81ff

View file

@ -2326,11 +2326,9 @@ _p9k_init_timer() {
# Test: PROMPT="${(pl:$((COLUMNS))::-:)}<%1(l.%2(l.FAIL.PASS).FAIL)> " zsh -dfis <<<exit # Test: PROMPT="${(pl:$((COLUMNS))::-:)}<%1(l.%2(l.FAIL.PASS).FAIL)> " zsh -dfis <<<exit
# Workaround: PROMPT="${(pl:$((COLUMNS))::-:)}%{%G%}<%1(l.%2(l.FAIL.PASS).FAIL)> " zsh -dfis <<<exit # Workaround: PROMPT="${(pl:$((COLUMNS))::-:)}%{%G%}<%1(l.%2(l.FAIL.PASS).FAIL)> " zsh -dfis <<<exit
function _p9k_prompt_overflow_bug() { function _p9k_prompt_overflow_bug() {
is-at-least 5.4.2 || return 1
[[ $ZSH_PATCHLEVEL =~ '^zsh-5\.4\.2-([0-9]+)-' ]] && return $(( match[1] < 159 )) [[ $ZSH_PATCHLEVEL =~ '^zsh-5\.4\.2-([0-9]+)-' ]] && return $(( match[1] < 159 ))
is-at-least 5.7.2 && return 1
[[ $ZSH_PATCHLEVEL =~ '^zsh-5\.7\.1-([0-9]+)-' ]] && return $(( match[1] >= 50 )) [[ $ZSH_PATCHLEVEL =~ '^zsh-5\.7\.1-([0-9]+)-' ]] && return $(( match[1] >= 50 ))
return 0 is-at-least 5.5 && ! is-at-least 5.7.2
} }
# Some people write POWERLEVEL9K_DIR_PATH_SEPARATOR='\uNNNN' instead of # Some people write POWERLEVEL9K_DIR_PATH_SEPARATOR='\uNNNN' instead of