1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-22 07:11:58 +00:00

lower the minimum required zsh version to 5.1

This commit is contained in:
romkatv 2019-04-30 13:39:27 +02:00
parent 361eec6f95
commit 79ea46de97
2 changed files with 7 additions and 4 deletions

View file

@ -314,4 +314,7 @@ This method of installation won't make anything slower or otherwise sub-par.
### What is the minimum supported zsh version?
Anything below 5.2 definitely won't work. 5.4 definitely will.
ZSH 5.1 or newer should work.
However, there are too many version, OS, platform, terminal and option configurations to test. If
Powerlevel10k doesn't work for you, please open an issue.

View file

@ -26,9 +26,9 @@ if test -z "${ZSH_VERSION}"; then
exit 1
fi
if ! autoload -U is-at-least || ! is-at-least 5.2; then
if ! autoload -U is-at-least || ! is-at-least 5.1; then
() {
>&2 echo -E "You are using ZSH version $ZSH_VERSION. The minimum required version for Powerlevel10k is 5.2."
>&2 echo -E "You are using ZSH version $ZSH_VERSION. The minimum required version for Powerlevel10k is 5.1."
>&2 echo -E "Type 'echo \$ZSH_VERSION' to see your current zsh version."
local def=${SHELL:c:A}
local cur=${${ZSH_ARGZERO#-}:c:A}
@ -37,7 +37,7 @@ if ! autoload -U is-at-least || ! is-at-least 5.2; then
>&2 echo -E "The shell you are currently running is likely $cur."
fi
local other=${${:-zsh}:c}
if [[ -n $other ]] && $other -c 'autoload -U is-at-least && is-at-least 5.2' &>/dev/null; then
if [[ -n $other ]] && $other -c 'autoload -U is-at-least && is-at-least 5.1' &>/dev/null; then
local other_v=$($other -c 'echo -E $ZSH_VERSION' 2>/dev/null)
if [[ -n $other_v && $other_v != $ZSH_VERSION ]]; then
>&2 echo -E "You have $other with version $other_v but this is not what you are using."