From 5f446f7f6386f8687db2609e932ae450a96e7bbe Mon Sep 17 00:00:00 2001 From: terminalforlife Date: Wed, 17 Feb 2021 22:25:38 +0000 Subject: [PATCH] Use BASH instead of AWK for Python version As the previous commit, but for Python's version. --- themes/base.theme.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 47be977f..a8018381 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -453,7 +453,9 @@ function condaenv_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}" }