mirror of
https://github.com/ChesterYue/ohmyzsh-theme-passion.git
synced 2026-07-21 20:11:03 +00:00
improve appearance of venv info
This commit is contained in:
parent
83755bd27b
commit
d5694fe648
1 changed files with 8 additions and 1 deletions
|
|
@ -210,7 +210,14 @@ _simplerich_prompt() {
|
||||||
if [ -v CONDA_DEFAULT_ENV ]; then
|
if [ -v CONDA_DEFAULT_ENV ]; then
|
||||||
echo "%{$fg[magenta]%}(${CONDA_DEFAULT_ENV})%{$reset_color%}"
|
echo "%{$fg[magenta]%}(${CONDA_DEFAULT_ENV})%{$reset_color%}"
|
||||||
elif [ -v VIRTUAL_ENV ]; then
|
elif [ -v VIRTUAL_ENV ]; then
|
||||||
echo "%{$fg[magenta]%}($(basename ${VIRTUAL_ENV}))%{$reset_color%}"
|
parent=$(dirname ${VIRTUAL_ENV})
|
||||||
|
if [[ "${PWD/#$parent/}" != "$PWD" ]]; then
|
||||||
|
# PWD is under the parent
|
||||||
|
echo "%{$fg[magenta]%}($(basename ${VIRTUAL_ENV}))%{$reset_color%}"
|
||||||
|
else
|
||||||
|
# PWD is not under the parent
|
||||||
|
echo "%{$fg[magenta]%}(${VIRTUAL_ENV/#$HOME/~})%{$reset_color%}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue