Use BASH instead of AWK for Python version

As the previous commit, but for Python's version.
pull/1840/head
terminalforlife 2021-02-17 22:25:38 +00:00
parent 3aa8592350
commit 5f446f7f63
1 changed files with 3 additions and 1 deletions

View File

@ -453,7 +453,9 @@ function condaenv_prompt {
} }
function py_interp_prompt { function py_interp_prompt {
py_version=$(python --version 2>&1 | awk 'NR==1{print "py-"$2;}') || return read _ py_version _ <<< "$(python --version 2>&1)" || return
[ $? -gt 0 ] && py_version="py-$py_version"
echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}" echo -e "${PYTHON_THEME_PROMPT_PREFIX}${py_version}${PYTHON_THEME_PROMPT_SUFFIX}"
} }