lvv / git-prompt

bash prompt with GIT, SVN and HG modules
http://volnitsky.com/project/git-prompt
327 stars 97 forks source link

git-prompt blocks the use of virtualenv's prompt decoration #2

Open offbyone opened 13 years ago

offbyone commented 13 years ago

Ian Bicking's virtualenv project amends the prompt when you select a virtualenv. git-prompt erases or blocks this content:

old::

me@myhost $ . venv/bin/activate
(venv) me@myhost $ deactivate
me@myhost $

git-prompt::

(D) offline@VOID.LOCAL ~> . venv/bin/activate
(D) offline@VOID.LOCAL ~> deactivate
(D) offline@VOID.LOCAL ~> 
niklas commented 13 years ago

What would be the expected behaviour?

PS: If this disturbs you in any way, you can disable virtualenv's prompt by setting VIRTUAL_ENV_DISABLE_PROMPT. (http://virtualenv.openplans.org/#activate-script)

offbyone commented 13 years ago

I would expect the virtualenv to prefix the prompt; probably something like this:

(D) offline@VOID.LOCAL ~> . venv/bin/activate
(venv) (D) offline@VOID.LOCAL ~> deactivate
(D) offline@VOID.LOCAL ~> 
niklas commented 13 years ago

@lvv I propose to only set PS1 when it has not been changed manually (check in prompt_command_function()). unset'ting it enables git-prompt again.

What do you think?

lvv commented 13 years ago

Coreranger's fork have commits to support virtualenv. I am about to merge it. But I can't test it. Can someone try it if it works?

navilan commented 13 years ago

I can confirm that it works as expected (quite nice).