42afa6e2ea663431ae2ff0a4aae8e57ce175eb4a

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(pyenv): quote % in `pyenv_prompt_info`

Diff

 1diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
 2index 39897ed161147b88e8864e7a9f49b106a69576cd..ebb1a708acfc55398d8392b2e41356d20164abe6 100644
 3--- a/plugins/pyenv/pyenv.plugin.zsh
 4+++ b/plugins/pyenv/pyenv.plugin.zsh
 5@@ -83,12 +83,14 @@ if [[ $FOUND_PYENV -eq 1 ]]; then
 6   fi
 7 
 8   function pyenv_prompt_info() {
 9-    echo "$(pyenv version-name)"
10+    local version="$(pyenv version-name)"
11+    echo "${version:gs/%/%%}"
12   }
13 else
14   # Fall back to system python
15   function pyenv_prompt_info() {
16-    echo "system: $(python -V 2>&1 | cut -f 2 -d ' ')"
17+    local version="$(python -V 2>&1 | cut -d' ' -f2)"
18+    echo "system: ${version:gs/%/%%}"
19   }
20 fi
21