From 80d1f26501b9f111681e5e4ac0d6600a8c5f896b Mon Sep 17 00:00:00 2001 From: Jacob Olson Date: Wed, 6 Mar 2024 14:06:53 -0700 Subject: [PATCH] mend --- themes/af-magic.zsh-theme | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index b7113d2d3..5c883a3e6 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_dir="${VIRTUAL_ENV:-$CONDA_DEFAULT_ENV}" - local python_env="${python_env_dir##*/}" + 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