add ability to set custom ps1 bash prompt #551

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@chrishiestand
chrishiestand commented Jan 18, 2014 edited

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 #509
and #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 shells 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

@chrishiestand chrishiestand add ability to set custom ps1
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
6fea9b6
@chrishiestand

Screenshot showing reversion of behavior without custom PS1:
screen shot 2014-01-17 at 6 51 07 pm

@chrishiestand chrishiestand changed the title from add ability to set custom ps1 prompt to add ability to set custom ps1 bash prompt Mar 27, 2014
@BrownTruck

Hello!

As part of an effort to ease the contribution process and adopt a more standard workflow pip has switched to doing development on the master branch. However, this Pull Request was made against the develop branch so it will need to be resubmitted against master. Unfortunately, this pull request does not cleanly merge against the current master branch.

If you do nothing, this Pull Request will be automatically closed by @BrownTruck since it cannot be merged.

If this pull request is still valid, please rebase it against master (or merge master into it) and resubmit it against the master branch, closing and referencing the original Pull Request.

If you choose to rebase/merge and resubmit this Pull Request, here is an example message that you can copy and paste:

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 #509
and #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 shells separately.

For this example, my .bash_profile contains this line:

VIRTUAL_ENV_PS1="${PS1%"\\$ "}\[\033[01;31m\](VIRTUAL_ENV_NAME)\[\033[00m\]\$ "

---

*This was migrated from pypa/virtualenv#551 to reparent it to the ``master`` branch. Please see original pull request for any previous discussion.*
@BrownTruck

This Pull Request was closed because it cannot be automatically reparented to the master branch and it appears to have bit rotted.

Please feel free to re-open it or re-submit it if it is still valid and you have rebased it onto master or merged master into it.

@BrownTruck BrownTruck closed this May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment