Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bash-powerline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@ __powerline() {
local git="$COLOR_GIT$(__git_info)$COLOR_RESET"
fi

PS1="$cwd$git$symbol"
# Checks to see if there is a virtual environment running by
# seeing if the VIRTUAL_ENV environmental variable is set.
if [ ! -z $VIRTUAL_ENV ]; then
IFS='/' read -a array <<< $VIRTUAL_ENV
local venv="$COLOR_SUCCESS(${array[-1]})$COLOR_RESET "
else
local venv=""
fi

PS1="$venv$cwd$git$symbol"

}

PROMPT_COMMAND="ps1${PROMPT_COMMAND:+; $PROMPT_COMMAND}"
Expand Down