fix(af-magic): add logic for virtualenv separator (#12875)

This commit is contained in:
Kalle Ahlström 2024-12-30 11:15:05 +02:00 committed by GitHub
parent 9c8afcc3ee
commit d82669199b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,6 +13,8 @@ function afmagic_dashes {
# the prompt, account for it when returning the number of dashes
if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then
echo $(( COLUMNS - ${#python_env} - 3 ))
elif [[ -n "$VIRTUAL_ENV_PROMPT" && "$PS1" = *${VIRTUAL_ENV_PROMPT}* ]]; then
echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} ))
else
echo $COLUMNS
fi