71e3f0979075401fd45ef4beeeb1fcd2adbdc8b5

Author
Nogweii <me@nogweii.net>
Committer
Nogweii <me@nogweii.net>
Date

Message

Check $AUTOSWITCH_DEFAULT_PYTHON for python binary name

Diff

 1diff --git a/autoswitch_virtualenv.plugin.zsh b/autoswitch_virtualenv.plugin.zsh
 2index 4bc2c7f80be163bd512c6bd913dcacb58005b104..5784d3586c4952b3cdfac39b4182f4810b08e8de 100644
 3--- a/autoswitch_virtualenv.plugin.zsh
 4+++ b/autoswitch_virtualenv.plugin.zsh
 5@@ -413,8 +413,9 @@ function disable_autoswitch_virtualenv() {
 6 # immediately removes itself from the zsh-hook.
 7 # This seems important for "instant prompt" zsh themes like powerlevel10k
 8 function _autoswitch_startup() {
 9-    if ! type "python" > /dev/null; then
10-        printf "WARNING: python binary not found on PATH.\n"
11+    local python_bin="${AUTOSWITCH_DEFAULT_PYTHON:-python}"
12+    if ! type "${python_bin}" > /dev/null; then
13+        printf "WARNING: python binary '${python_bin}' not found on PATH.\n"
14         printf "zsh-autoswitch-virtualenv plugin will be disabled.\n"
15     else
16         add-zsh-hook -D precmd _autoswitch_startup