Commit ebfc9042 authored by Gong Hao's avatar Gong Hao
Browse files

add virtualenv prompt support for agnoster theme

parent 78dba754
...@@ -134,6 +134,14 @@ prompt_dir() { ...@@ -134,6 +134,14 @@ prompt_dir() {
prompt_segment blue black '%~' prompt_segment blue black '%~'
} }
# Virtualenv: current working virtualenv
prompt_virtualenv() {
local virtualenv_path="$VIRTUAL_ENV"
if [[ -n $virtualenv_path ]]; then
prompt_segment blue black "(`basename $virtualenv_path`)"
fi
}
# Status: # Status:
# - was there an error # - was there an error
# - am I root # - am I root
...@@ -152,6 +160,7 @@ prompt_status() { ...@@ -152,6 +160,7 @@ prompt_status() {
build_prompt() { build_prompt() {
RETVAL=$? RETVAL=$?
prompt_status prompt_status
prompt_virtualenv
prompt_context prompt_context
prompt_dir prompt_dir
prompt_git prompt_git
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment