Skip to content

A snippet for .zshrc to add colored zsh prompt prefix for Python venv

Notifications You must be signed in to change notification settings

ept221/color-venv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

color-venv

A snippet for .zshrc to add colored zsh prompt prefix for Python venv

prompt

autoload -U colors && colors

export DEFAULT_PROMPT=$PS1

export VIRTUAL_ENV_DISABLE_PROMPT=1s
precmd() {
    if [ -n "${VIRTUAL_ENV:-}" ] ; then
        export PS1="%B%{$fg[green]%}($(basename $VIRTUAL_ENV))%{$reset_color%}%b $DEFAULT_PROMPT"
    else 
        export PS1=$DEFAULT_PROMPT
    fi
}

About

A snippet for .zshrc to add colored zsh prompt prefix for Python venv

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published