Cleaner PS1: Do not display '.venv', we know it's .venv, it's always .venv.

This commit is contained in:
Julien Palard 2023-01-20 13:55:52 +01:00
parent c174ac7e17
commit 6c8b68040d
Signed by: mdk
GPG Key ID: 0EFC1AC1006886F8
1 changed files with 8 additions and 2 deletions

View File

@ -86,7 +86,13 @@ python_ps1()
then
pypath="$relative"
fi
printf "$1" "${pypath%/bin/python}"
local venvpath="${pypath%/bin/python}"
if [[ "$venvpath" == ".venv" ]]
then
printf "$1"
else
printf "$1" "$venvpath "
fi
}
if [[ "$TERM" != 'dumb' ]]