File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,19 @@ function git_prompt_info() {
1818 echo -e " $SCM_PREFIX ${bold_red} $SCM_BRANCH$SCM_STATE$SCM_SUFFIX "
1919}
2020
21+ function venv_prompt() {
22+ python_venv=" "
23+ # Detect python venv
24+ if [[ -n " ${CONDA_DEFAULT_ENV} " ]]; then
25+ python_venv=" ($PYTHON_VENV_CHAR ${CONDA_DEFAULT_ENV} ) "
26+ elif [[ -n " ${VIRTUAL_ENV} " ]]; then
27+ python_venv=" ($PYTHON_VENV_CHAR $( basename " ${VIRTUAL_ENV} " ) ) "
28+ fi
29+ [[ -n " ${python_venv} " ]] && echo " ${python_venv} "
30+ }
31+
2132function prompt_command() {
22- PS1=" ${bold_green} ➜ ${bold_cyan} \W${reset_color} $( scm_prompt_info) ${normal} "
33+ PS1=" $( venv_prompt ) $ {bold_green} ➜ ${bold_cyan} \W${reset_color} $( scm_prompt_info) ${normal} "
2334}
2435
2536PROMPT_COMMAND=prompt_command
You can’t perform that action at this time.
0 commit comments