feat(theme): Make agnoster support conda environment

This commit is contained in:
赵春旭 2024-11-14 16:35:59 +08:00
commit 0207f6f8f4

View file

@ -314,6 +314,9 @@ prompt_dir() {
# Virtualenv: current working virtualenv # Virtualenv: current working virtualenv
prompt_virtualenv() { prompt_virtualenv() {
if [ -n "$CONDA_DEFAULT_ENV" ]; then
prompt_segment magenta $CURRENT_FG "🐍 $CONDA_DEFAULT_ENV"
fi
if [[ -n "$VIRTUAL_ENV" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then if [[ -n "$VIRTUAL_ENV" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then
prompt_segment "$AGNOSTER_VENV_BG" "$AGNOSTER_VENV_FG" "(${VIRTUAL_ENV:t:gs/%/%%})" prompt_segment "$AGNOSTER_VENV_BG" "$AGNOSTER_VENV_FG" "(${VIRTUAL_ENV:t:gs/%/%%})"
fi fi
@ -354,9 +357,9 @@ prompt_aws() {
build_prompt() { build_prompt() {
RETVAL=$? RETVAL=$?
prompt_status prompt_status
prompt_virtualenv
prompt_aws prompt_aws
prompt_context prompt_context
prompt_virtualenv
prompt_dir prompt_dir
prompt_git prompt_git
prompt_bzr prompt_bzr