diff options
| author | Thomas Schmucker <ts@its1.de> | 2026-01-30 11:06:28 +0100 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2026-01-30 11:06:28 +0100 |
| commit | 98d8a7c1ba6f3d2c546e25394f3045835975834a (patch) | |
| tree | b816b2b5d1e1ab49d248b2268d3ce713a328ef1f /zsh/zshrc | |
| parent | e1a2d77f447e31f9267e194d6f8ffea19a0c4c86 (diff) | |
| download | dotfiles-98d8a7c1ba6f3d2c546e25394f3045835975834a.tar.gz dotfiles-98d8a7c1ba6f3d2c546e25394f3045835975834a.tar.bz2 dotfiles-98d8a7c1ba6f3d2c546e25394f3045835975834a.zip | |
zsh: Teste im cd-hook, ob wirklich eine Python-VEnv aktiv ist
Diffstat (limited to 'zsh/zshrc')
| -rw-r--r-- | zsh/zshrc | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -2,9 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | # Hooks | 3 | # Hooks |
| 4 | function chpwd() { | 4 | function chpwd() { |
| 5 | if [[ -n "$VIRTUAL_ENV" ]]; then | 5 | if [[ -n "$VIRTUAL_ENV" && -f "$VIRTUAL_ENV/bin/activate" ]]; then |
| 6 | local venv_dir="${VIRTUAL_ENV:h}" | 6 | local venv_dir="${VIRTUAL_ENV:h}" |
| 7 | if [[ "$PWD" != "$venv_dir"* ]]; then | 7 | if [[ "$PWD" != "$venv_dir"* ]] && (( $+functions[deactivate] )); then |
| 8 | deactivate | 8 | deactivate |
| 9 | fi | 9 | fi |
| 10 | fi | 10 | fi |
