Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompt show double python virtualenv #19

Closed
arshavindn opened this issue May 26, 2016 · 7 comments
Closed

prompt show double python virtualenv #19

arshavindn opened this issue May 26, 2016 · 7 comments
Labels
bug Bug related to code base, behavior, displaying, etc.

Comments

@arshavindn
Copy link

just like in attatched picture
terminix default_081

@denysdovhan denysdovhan added the bug Bug related to code base, behavior, displaying, etc. label May 27, 2016
@denysdovhan
Copy link
Member

denysdovhan commented May 27, 2016

@arshavindn should works. Please check. (Don't forget to update, before!)

@arshavindn
Copy link
Author

And here is one more thing, which this virtualenv is actived, then I run command "exec zsh", which mean replace with a new zsh instance, but the prompt still shows the virtualenv

@denysdovhan
Copy link
Member

@arshavindn why don't you use deactivate command for stopping virtualenv? Using of exec zsh seems like a kinda hack.

@arshavindn
Copy link
Author

of course I use deactivate, but just in case sometime it makes me confuse if I have to restart the shell

@denysdovhan
Copy link
Member

denysdovhan commented May 27, 2016

Well, the part that depends on virtualenv is quite simple:

# Virtual environment.
# Show current virtual environment (Python).
spaceship_venv_status() {
  [[ $SPACESHIP_VENV_SHOW == false ]] && return

  # Check if the current directory running via Virtualenv
  [ -n "$VIRTUAL_ENV" ] || return
  echo -n " %Bvia%b "
  echo -n "%{$fg_bold[blue]%}"
  echo -n "$(basename $VIRTUAL_ENV)"
  echo -n "%{$reset_color%}"
}

If $VIRTUAL_ENV is defined, then spaceship shows its name. So it's possible when you reload your prompt this variable is still defined. I don't think this is a trouble in this theme.

@triostones
Copy link

Put export VIRTUAL_ENV_DISABLE_PROMPT=true in ~/.zshrc fix this problem.

@yejunjin
Copy link

yejunjin commented Mar 8, 2018

@triostones thanks, it works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug related to code base, behavior, displaying, etc.
Development

No branches or pull requests

4 participants