Spaceship-prompt: prompt show double python virtualenv

Created on 26 May 2016  路  7Comments  路  Source: denysdovhan/spaceship-prompt

just like in attatched picture
terminix default_081

bug

Most helpful comment

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

All 7 comments

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

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

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

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

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.

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

@triostones thanks, it works for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

janjur picture janjur  路  3Comments

gillesdemey picture gillesdemey  路  3Comments

conradwt picture conradwt  路  3Comments

MatthiasJ picture MatthiasJ  路  4Comments

Vvkmnn picture Vvkmnn  路  3Comments