Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
Update VIRTUAL_ENV_DISABLE_PROMPT value
Browse files Browse the repository at this point in the history
Following prezto update
  • Loading branch information
josselinauguste committed Nov 18, 2018
1 parent 724781e commit 5c412b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion powerlevel9k.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

3 comments on commit 5c412b4

@shengje
Copy link

@shengje shengje commented on 5c412b4 Dec 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@dritter dritter commented on 5c412b4 Dec 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

@shengje shengje commented on 5c412b4 Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.