1diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme
2index 2ef9b02d7afa46d969c0b8bd26c7d3a2ed086556..1b629e43a50e1ab864729937902d5411835bb2bb 100644
3--- a/themes/af-magic.zsh-theme
4+++ b/themes/af-magic.zsh-theme
5@@ -10,7 +10,7 @@ function afmagic_dashes {
6 7 # if there is a python virtual environment and it is displayed in
8 # the prompt, account for it when returning the number of dashes
9- if [[ -n "$python_env" && "$PS1" = \(* ]]; then
10+ if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
11 echo $(( COLUMNS - ${#python_env} - 3 ))
12 else
13 echo $COLUMNS