Skip to content

Instantly share code, notes, and snippets.

@kiruh
Created May 12, 2021 12: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 kiruh/5f7647f492112d9cf18aaa289027f02e to your computer and use it in GitHub Desktop.
Save kiruh/5f7647f492112d9cf18aaa289027f02e to your computer and use it in GitHub Desktop.
direnv
eval "$(direnv hook bash)"
show_virtual_env() {
if [ -n "$VIRTUAL_ENV" ]; then
echo "($(basename $VIRTUAL_ENV)) "
fi
}
PS1='$(show_virtual_env)'$PS1
layout_virtualenv() {
local venv_path="$1"
source ${venv_path}/bin/activate
}
layout virtualenv ~/.virtualenvs/cs
unset PS1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment