summaryrefslogtreecommitdiff
path: root/themes/af-magic.zsh-theme
diff options
context:
space:
mode:
Diffstat (limited to 'themes/af-magic.zsh-theme')
-rw-r--r--themes/af-magic.zsh-theme5
1 files changed, 3 insertions, 2 deletions
diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
index 2ef9b02d7..70549d01f 100644
--- a/themes/af-magic.zsh-theme
+++ b/themes/af-magic.zsh-theme
@@ -6,11 +6,12 @@
# 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
+ if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
else
echo $COLUMNS