Skip to content

Instantly share code, notes, and snippets.

@Atala
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Atala/c4b90a6782b211310c5d to your computer and use it in GitHub Desktop.
Save Atala/c4b90a6782b211310c5d to your computer and use it in GitHub Desktop.
Snippet for postactivate hook
#!/bin/bash
# This hook is sourced after every virtualenv is activated.
proj_name=$(basename $VIRTUAL_ENV)
cd ~/src/$proj_name
# show virtualenv
PS1="$_OLD_VIRTUAL_PS1"
_OLD_RPROMPT="$RPROMPT"
RPROMPT="%{${fg_bold[white]}%}(env: %{${fg[green]}%}`basename \"$VIRTUAL_ENV\"`%{${fg_bold[white]}%})%{${reset_color}%} $RPROMPT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment