GetStream / vg

Virtualgo: Easy and powerful workspace based development for go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vg environment name does not display in the zsh

hadisinaee opened this issue · comments

commented

Hi,

I'm using POWERLEVEL9K theme on zsh. When I activate a virtual environment, the theme doesn't change to show the name of the current environment. I sometimes forgot to deactivate it. How to set up zsh for showing the name of activated environment?

thanks

P.S: I'm using OSX and my zsh is the latest version.

I think your theme overrides the default prompt changes that vg does. Luckily, it's quite easy to do the same yourself. vg sets the $VIRTUALGO shell variable to the name of the current environment. So if you can modify your theme to use that inside the prompt and see the current environment. (the simplest way to try it out is echo $VIRTUALGO)

Closing this as I think this is clear now. Feel free to reopen if you still have issues.

commented

I fixed it. Thank you for $VIRTUALGO variable. I add the following to my .zshrc:

zsh_vg_env_name(){
    local color='%F{yellow}'
    if [ ! -z "$VIRTUALGO" ]; then
        echo -n "%{$color%}$VIRTUALGO"
    fi
}

POWERLEVEL9K_CUSTOM_VG_ENV_NAME="zsh_vg_env_name"
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status custom_vg_env_name root_indicator background_jobs history time)