check if last command successful
parent
bb6354e205
commit
54bf7f9a59
|
|
@ -39,19 +39,23 @@ detect_venv() {
|
||||||
python_venv=""
|
python_venv=""
|
||||||
# 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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n${bold_red}└─▪${normal} "
|
||||||
|
else
|
||||||
|
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ "
|
||||||
|
fi
|
||||||
detect_venv
|
detect_venv
|
||||||
|
PS1+="${python_venv}${dir_color}"
|
||||||
PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\u${normal}][${cyan}\w${normal}]$(is_vim_shell)\n└─▪ ${python_venv}${dir_color} "
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PS2="└─▪ "
|
PS2="└─▪ "
|
||||||
|
|
||||||
safe_append_prompt_command prompt
|
safe_append_prompt_command prompt
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue