add venv
This commit is contained in:
parent
da12302f5d
commit
f76ebf8ef2
16
.bashrc
16
.bashrc
@ -5,6 +5,18 @@ parse_git_branch() {
|
||||
}
|
||||
|
||||
|
||||
virtualenv_info() {
|
||||
# Get Virtual Env
|
||||
if [[ -n "$VIRTUAL_ENV" ]]; then
|
||||
# Strip out the path and just leave the env name
|
||||
venv="${basename $VIRTUAL_ENV}"
|
||||
else
|
||||
# In case you don't have one activated
|
||||
venv=''
|
||||
fi
|
||||
[[ -n "$venv" ]] && echo "($venv)"
|
||||
}
|
||||
|
||||
close_color='\[\e[m\]'
|
||||
prompt_color='\[\033[;32m\]'
|
||||
info_color='\[\033[1;34m\]'
|
||||
@ -24,6 +36,8 @@ if [ -f ~/.bash_aliases ]; then
|
||||
source ~/.bash_aliases
|
||||
fi
|
||||
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
VENV="\$(virtualenv_info)";
|
||||
|
||||
# last
|
||||
PS1="\n$prompt_color┌─${VIRTUAL_ENV:+($(basename $VIRTUAL_ENV))}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color\$(parse_git_branch)$close_color\n$prompt_color└─$close_color$info_color$end_symbol$close_color "
|
||||
PS1="\n$prompt_color┌─${VENV}─($close_color$info_color\u$prompt_symbol\H$close_color$prompt_color)-[$close_color\w$prompt_color]$close_color $red_color\$(parse_git_branch)$close_color\n$prompt_color└─$close_color$info_color$end_symbol$close_color "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user