themes/agnoster: Changes in prompt_virtualenv() function in order to show the python version and not the folder name. (#147)

This commit is contained in:
lucasgnavarro 2020-06-11 05:38:32 -03:00 committed by GitHub
parent 2a41e70e92
commit 749823b78f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -208,13 +208,18 @@ prompt_end() {
### virtualenv prompt
prompt_virtualenv() {
if [[ -n $VIRTUAL_ENV ]]; then
# the last word in --version command correspond to version number
for e in $($VIRTUAL_ENV/bin/python --version)
do
VENV_VERSION=$e
done
color=cyan
prompt_segment $color $PRIMARY_FG
prompt_segment $color white "$(basename $VIRTUAL_ENV)"
prompt_segment $color white "$(basename $VENV_VERSION)"
fi
}
### Prompt components
# Each component will draw itself, and hide itself if no information needs to be shown