Permalink
Browse files

Update VIRTUAL_ENV_DISABLE_PROMPT value

Following prezto update
  • Loading branch information...
josselinauguste committed Nov 17, 2018
1 parent 724781e commit 5c412b4d420a2226cbf8af4ab38c61154df858e4
Showing with 1 addition and 1 deletion.
  1. +1 −1 powerlevel9k.zsh-theme
@@ -1648,7 +1648,7 @@ prompt_vi_mode() {
# https://virtualenv.pypa.io/en/latest/
prompt_virtualenv() {
local virtualenv_path="$VIRTUAL_ENV"
if [[ -n "$virtualenv_path" && "$VIRTUAL_ENV_DISABLE_PROMPT" != true ]]; then
if [[ -n "$virtualenv_path" && -z "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$(basename "$virtualenv_path")" 'PYTHON_ICON'
fi
}

3 comments on commit 5c412b4

@shengje

This comment has been minimized.

shengje replied Dec 6, 2018

I try this theme for a while but can not print the prompt virtualenv correctly.
Finally I change the code like this
if [[ -n "$virtualenv_path" && -z "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then
need to change into
if [[ -n "$virtualenv_path" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then

I'm not sure is my own problem or bug, just let anyone who has same problem to know this.
(my system : ubuntu 18.04 LTS with shell OMZ )

@dritter

This comment has been minimized.

Collaborator

dritter replied Dec 6, 2018

Hi @shengje ,

To be honest, your suggested change does not look right to me. And to be fair, @josselinauguste doesn't look right either. The Variable is named disable_prompt , so it expects a certain value like true or false. Checking the entire variable for (non) zero length does not work if the variable is set to true/false:
screenshot_20181206_181444

As a workaround, if you do unset VIRTUAL_ENV_DISABLE_PROMPT, it should work..

@shengje

This comment has been minimized.

shengje replied Dec 7, 2018

Hi @dritter ,
Thanks for correcting my suggestion!
Now I knew this workflow of this script.
This correction references by the theme in the original OMZ package.
I found that there is no variable VIRTUAL_ENV_DISABLE_PROMPT setting true or false in this code by default.
Is it equal unset VIRTUAL_ENV_DISABLE_PROMPT ?

Please sign in to comment.