Commit d262fd2b authored by Maxime Bombar's avatar Maxime Bombar

Affiche le nom du virtualenv au lieu de venv

parent dbd8667c
......@@ -301,18 +301,19 @@ precmd () {
if [ -n "${VIRTUAL_ENV:-}" ]; then
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ]; then
IFS='/'
read -A D <<< "${VIRTUAL_ENV}"
if [ -z "${VIRTUAL_ENV_DISABLE_DIRECTORY:-}" ]; then
IFS='/'
read -A D <<< "${VIRTUAL_ENV}"
venv_directory=":${D[-2]}"
fi
venv="(venv$venv_directory)%B%F{red}$prompt_hyphen"
venv="(${D[-1]}$venv_directory)%B%F{red}$prompt_hyphen"
fi
else
unset venv
unset venv_directory
unset IFS
unset D
fi
unset IFS
# And, makes it good
PS1="$prompt_line_1$prompt_newline$prompt_line_2${venv}%B%F{red}${EXITCODE}%b%F{$prompt_color1}$prompt_hyphen%B%F{white}$prompt_char %b%f%k"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment