From 98d8a7c1ba6f3d2c546e25394f3045835975834a Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Fri, 30 Jan 2026 11:06:28 +0100 Subject: zsh: Teste im cd-hook, ob wirklich eine Python-VEnv aktiv ist --- zsh/zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zsh') diff --git a/zsh/zshrc b/zsh/zshrc index 71b30ba..877ab70 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -2,9 +2,9 @@ # Hooks function chpwd() { - if [[ -n "$VIRTUAL_ENV" ]]; then + if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then local venv_dir="${VIRTUAL_ENV:h}" - if [[ "$PWD" != "$venv_dir"* ]]; then + if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then deactivate fi fi -- cgit v1.3