浏览代码

pyenv: ignore $PATH pyenv if on WSL

This solves the problem where the used pyenv is actually the one in a
Windows folder, instead of in WSL.

Fixes #9034
Marc Cornellà 3 年之前
父节点
当前提交
9703111b82
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      plugins/pyenv/pyenv.plugin.zsh

+ 5 - 1
plugins/pyenv/pyenv.plugin.zsh

@@ -2,7 +2,11 @@
 # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
 
 # Load pyenv only if command not already available
-command -v pyenv &> /dev/null && FOUND_PYENV=1 || FOUND_PYENV=0
+if command -v pyenv &> /dev/null && [[ "$(uname -r)" != *icrosoft* ]]; then
+    FOUND_PYENV=1
+else
+    FOUND_PYENV=0
+fi
 
 if [[ $FOUND_PYENV -ne 1 ]]; then
     pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")