jimeh / git-aware-prompt

Display current Git branch name in your terminal prompt when in a Git working directory.
Creative Commons Zero v1.0 Universal
2.16k stars 340 forks source link

rewrites virtualenv env out to show just current branch #45

Closed etsalah closed 8 years ago

etsalah commented 8 years ago

after activate a virtual environment in python it gives you an indication of which branch you currently are by pre-pending the current environment name to you prompt. Example if you environment's name is env then you get a prompt like (env) home/user/path_to_environment/src

However after running git-aware-prompt, script that is in my .profile file because am using ubuntu, the prompt changes to

home/user/path_to_environment/src (master)

What i expected was to get something like

(env) home/user/path_to_environment/src (master)

This happens when you execute execute

source $HOME/.profile

after runing source env/bin/activate

jimeh commented 8 years ago

It seems virtualenv modifies the PS1 shell variable to achieve this, which you're overriding to add the git information.

You'll need to add the virtualenv information to the PS1 variable you're setting to get the bit branch into the prompt. I found this answer on Stackoverflow that might help you configure your PS1 variable as needed: http://stackoverflow.com/a/20026992

etsalah commented 8 years ago

That worked thanks