activate.csh saved the prompt unconditionally, but the prompt variable
only exists in interactive shells, and csh fails on an undefined
variable.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
setenv VIRTUAL_ENV_PROMPT __VENV_PROMPT__
-set _OLD_VIRTUAL_PROMPT="$prompt"
+if ($?prompt) then
+ set _OLD_VIRTUAL_PROMPT="$prompt"
-if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
- set prompt = "("__VENV_PROMPT__") $prompt:q"
+ if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
+ set prompt = "("__VENV_PROMPT__") $prompt:q"
+ endif
endif
alias pydoc python -m pydoc
--- /dev/null
+Fix :mod:`venv` activation in a non-interactive csh:
+``activate.csh`` no longer fails
+when the ``prompt`` variable is not set.