diff --git a/config/.bashrc b/config/.bashrc index 23a7bf9..698c45a 100755 --- a/config/.bashrc +++ b/config/.bashrc @@ -121,8 +121,8 @@ if [ -n "$PS1" ]; then c_cwd="$(tput setaf 99)" c_time="$(tput setaf 33)" #Light blue c_branch="$(tput setaf 138)" - c_exit="$(tput setaf 203)" #Red - c_jobs="$(tput setaf 220)" #Yellow + c_error="$(tput setaf 203)" #Red + c_info="$(tput setaf 220)" #Yellow else c_reset="$(tput sgr0)" c_user="$(tput setaf 1)" # @@ -130,8 +130,8 @@ if [ -n "$PS1" ]; then c_cwd="$(tput setaf 7)" #White c_time="$(tput setaf 6)" #Cyan c_branch="$(tput setaf 6)" #Cyan - c_exit="$(tput setaf 1)" #Red - c_jobs="$(tput setaf 3)" #Yellow + c_error="$(tput setaf 1)" #Red + c_info="$(tput setaf 3)" #Yellow fi [ -n "$(which svn)" ] && prompt_check_svn=true @@ -177,21 +177,29 @@ if [ -n "$PS1" ]; then # exit code if not zero # if [ "$exit_code" -ne "0" ]; then - PS1+=",\[$c_exit\]rc=$exit_code" + PS1+=",\[$c_error\]rc=$exit_code" + fi + # + # Python venv. + # + local jobs_bg=$(jobs -r | wc -l | tr -d ' ') + if [ -n "$VIRTUAL_ENV" ]; then + # PS1+=",\[$c_info\]$(realpath --relative-to=$PWD $VIRTUAL_ENV)" + PS1+=",\[$c_info\]$(basename $VIRTUAL_ENV)" fi # # Info about jobs. # local jobs_bg=$(jobs -r | wc -l | tr -d ' ') if [ $jobs_bg -gt 0 ]; then - PS1+=",\[$c_jobs\]bg=$jobs_bg" + PS1+=",\[$c_info\]bg=$jobs_bg" fi # # Info about jobs. # local jobs_stopped=$(jobs -s | wc -l | tr -d ' ') if [ $jobs_stopped -gt 0 ]; then - PS1+=",\[$c_jobs\]stp=$jobs_stopped" + PS1+=",\[$c_info\]stp=$jobs_stopped" fi