From c6ec8d503136e2ad3f6929260dda0728ccec8a09 Mon Sep 17 00:00:00 2001 From: ardentsword Date: Tue, 7 Feb 2017 10:50:14 +0000 Subject: [PATCH] Added python virtualenv path to command line --- bash/.bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index eecd54f..34b887a 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -86,12 +86,19 @@ BMAG="\[\033[105m\]" # background magenta BCYN="\[\033[106m\]" # background cyan BWHT="\[\033[107m\]" # background white +# Determine active Python virtualenv details. +if test -z "$VIRTUAL_ENV" ; then + PYTHON_VIRTUALENV="" +else + PYTHON_VIRTUALENV="${BLUE}[`basename \"$VIRTUAL_ENV\"`]${COLOR_NONE} " +fi + if [ "$color_prompt" = yes ]; then # PS1FRONT="$HC$FMAG[ $FGRN${debian_chroot:+($debian_chroot)}\u$FYEL@$FGRN\h$FYEL: $FBLE\w" # # PS1FRONT="$FMAG[ $FGRN\u$FYEL@$FGRN\h$FYEL" # PS1FRONT="$FMAG[ $FBLK$BGRN$FBLK \u $FGRN$BBLK$FBLK$BYEL$FBLK \h $FYEL$BBLK$FBLK$BBLE$FBLK \w $FBLE$BBLK " if [ "$LC_PUTTY_FONT" = "powerline" ]; then - PS1FRONT=" $FBLK$BGRN$FBLK \h $FGRN$BYEL$FBLK \u $FYEL$BBLE$FBLK \w $BBLK" + PS1FRONT="$FBLK$BGRN$FBLK \h $FGRN$BYEL$FBLK \u $FYEL$BBLE$FBLK ${PYTHON_VIRTUALENV}\w $BBLK" PS1BACK="$FBLE$BBLK $RS" else PS1FRONT="$HC$FMAG[ $FGRN${debian_chroot:+($debian_chroot)}\u$FYEL@$FGRN\h$FYEL: $FBLE\w"