Skip to content

Commit

Permalink
Show python version instead of venv name
Browse files Browse the repository at this point in the history
If you've activated a virtual environment, now it shows the python
version as major.minor (no patch version).
  • Loading branch information
PsychoLlama committed Oct 31, 2017
1 parent c5455f4 commit 53c3ba8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llama.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function llama_venv_status {
return
fi

title="%{$fg[cyan]%}$(basename "$VIRTUAL_ENV")"
python_version="$(python --version 2>&1)"
version_only="${python_version/Python /}"
echo "$version_only" | IFS="." read major minor patch
title="%{$fg[cyan]%}$major.$minor"

if [[ ! -z "$1" ]]; then
title="%{$fg[yellow]%}($title%{$fg[yellow]%})"
Expand Down

0 comments on commit 53c3ba8

Please sign in to comment.