Fix venv display (tested for local and ssh prompt)

pull/1681/head
BarbUk 2020-10-20 12:06:15 +02:00
parent e05dfc6933
commit e164b18eb8
No known key found for this signature in database
GPG Key ID: DB301C759539E9FE
1 changed files with 3 additions and 3 deletions

View File

@ -91,12 +91,12 @@ function _prompt {
# Detect python venv # Detect python venv
if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then if [[ -n "${CONDA_DEFAULT_ENV}" ]]; then
python_venv="$PYTHON_VENV_CHAR ${CONDA_DEFAULT_ENV}" python_venv="$PYTHON_VENV_CHAR${CONDA_DEFAULT_ENV} "
elif [[ -n "${VIRTUAL_ENV}" ]]; then elif [[ -n "${VIRTUAL_ENV}" ]]; then
python_venv="$PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}")" python_venv="$PYTHON_VENV_CHAR$(basename "${VIRTUAL_ENV}") "
fi fi
PS1="\\n${ssh_info} ${python_venv} ${purple}$(scm_char)${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}" PS1="\\n${ssh_info} ${purple}$(scm_char)${python_venv}${dir_color}\\w${normal}$(scm_prompt_info)${exit_code}"
[[ ${#PS1} -gt $((COLUMNS*3)) ]] && wrap_char="\\n" [[ ${#PS1} -gt $((COLUMNS*3)) ]] && wrap_char="\\n"
PS1="${PS1}${wrap_char}${normal} " PS1="${PS1}${wrap_char}${normal} "