diff --git a/lib/git.zsh b/lib/git.zsh index e220d83bb..7e6fdae65 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -19,6 +19,7 @@ function git_prompt_info() { local ref ref=$(__git_prompt_git symbolic-ref --short HEAD 2> /dev/null) \ + || ref=$(__git_prompt_git describe --tags --exact-match HEAD 2> /dev/null) \ || ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) \ || return 0 diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 9e8b1b11f..b7113d2d3 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -6,8 +6,8 @@ # dashed separator size function afmagic_dashes { # check either virtualenv or condaenv variables - local python_env="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}" - + local python_env_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}" + local python_env="${python_env_dir##*/}" # if there is a python virtual environment and it is displayed in # the prompt, account for it when returning the number of dashes if [[ -n "$python_env" && "$PS1" = \(* ]]; then