mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
fix virtualenv's with virtualenv plugin / prompt display
Virtual Env modifies the prompt in such a way that when used with agnoster the virtualenv will be displayed twice. Using the virtualenv oh-my-zsh plugin disables this behavior (simply because it disables the virtual env prompt mangling) however when using the plugin it would be nice to keep the single prompt display as expected, and still allow for the function to provide prompt info which other themes may use.
This commit is contained in:
parent
e30a1243dc
commit
cd42812c9b
2 changed files with 6 additions and 1 deletions
|
|
@ -6,3 +6,4 @@ function virtualenv_prompt_info(){
|
|||
|
||||
# disables prompt mangling in virtual_env/bin/activate
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT=1
|
||||
export VIRTUAL_ENV_DISABLE_PROMPT_BY_PLUGIN=1
|
||||
|
|
|
|||
|
|
@ -137,7 +137,11 @@ prompt_dir() {
|
|||
# Virtualenv: current working virtualenv
|
||||
prompt_virtualenv() {
|
||||
local virtualenv_path="$VIRTUAL_ENV"
|
||||
if [[ -n $virtualenv_path && -z $VIRTUAL_ENV_DISABLE_PROMPT ]]; then
|
||||
if [[ -n $virtualenv_path &&
|
||||
( -z $VIRTUAL_ENV_DISABLE_PROMPT ||
|
||||
( -n $VIRTUAL_ENV_DISABLE_PROMPT &&
|
||||
-n $VIRTUAL_ENV_DISABLE_PROMPT_BY_PLUGIN )
|
||||
) ]]; then
|
||||
prompt_segment blue black "(`basename $virtualenv_path`)"
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue