pypa/virtualenv — pull request #551 by chrishiestand (2014-01-18 02:45:42+00:00)
Title: add ability to set custom ps1 prompt

activate.sh:
* uses $VIRTUAL_ENV_PS1 which would be set in e.g. .bash_profile
* add set_custom_ps1()
* convert backticks to $() for readability
* fix incorrect usage of quotes, removes backslashes from:
basename \"$VIRTUAL_ENV\"
* add VIRTUAL_ENV_NAME variable for readability

This is my suggested alternative to https://github.com/pypa/virtualenv/pull/509
and https://github.com/pypa/virtualenv/pull/390

I'd be happy to make additional changes required for acceptance.

Note: this only adds support for a custom ps1 for bash - support would need to be added to the other shell separately.

For this example, my .bash_profile contains this line:
VIRTUAL_ENV_PS1="${PS1%"\\$ "}\[\033[01;31m\](VIRTUAL_ENV_NAME)\[\033[00m\]\$ "

![screen shot 2014-01-17 at 6 44 55 pm](https://f.cloud.github.com/assets/100825/1946099/94fd20f8-7fea-11e3-9e8d-9ea136bfccad.png)