1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-02-11 05:39:45 +08:00

Compare commits

...

5 Commits

Author SHA1 Message Date
AYO-YO
a28efd67b9
Merge f4b09de2e7 into 67cd8c4673 2026-01-26 16:10:22 +08:00
赵春旭
f4b09de2e7 feat(theme): Optimize the display effect of conda in the agnoster theme; standardize the code 2025-06-13 09:40:51 +08:00
AYO_YO
4974ffa6a0
Merge branch 'ohmyzsh:master' into master 2025-06-13 09:39:59 +08:00
Carlo Sala
65c3e10e38
revert to original order 2025-06-08 10:22:26 +02:00
赵春旭
0207f6f8f4 feat(theme): Make agnoster support conda environment 2025-06-08 11:29:40 +08:00

View File

@ -80,6 +80,8 @@ esac
# VirtualEnv colors # VirtualEnv colors
: ${AGNOSTER_VENV_FG:=black} : ${AGNOSTER_VENV_FG:=black}
: ${AGNOSTER_VENV_BG:=blue} : ${AGNOSTER_VENV_BG:=blue}
: ${AGNOSTER_CONDA_FG:=${CURRENT_FG}}
: ${AGNOSTER_CONDA_BG:=magenta}
# AWS Profile colors # AWS Profile colors
: ${AGNOSTER_AWS_PROD_FG:=yellow} : ${AGNOSTER_AWS_PROD_FG:=yellow}
@ -314,9 +316,15 @@ prompt_dir() {
# Virtualenv: current working virtualenv # Virtualenv: current working virtualenv
prompt_virtualenv() { prompt_virtualenv() {
if [ -n "$CONDA_DEFAULT_ENV" ]; then if [[ -n $CONDA_DEFAULT_ENV && -z $CONDA_ENV_DISABLE_PROMPT ]]; then
prompt_segment magenta $CURRENT_FG "🐍 $CONDA_DEFAULT_ENV" # You can execute this command to disable conda native prompt.
# `conda config --set changeps1 False`
local conda_prompt_prefix=${CONDA_PROMPT_PREFIX:-"🐍 "}
# local conda_prompt_prefix="$CONDA_PROMPT_PREFIX"
prompt_segment "$AGNOSTER_CONDA_BG" "$AGNOSTER_CONDA_FG" "$conda_prompt_prefix$CONDA_DEFAULT_ENV"
fi 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