summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMikuHatsune39 <32179075+MikuHatsune39@users.noreply.github.com>2023-11-24 00:35:46 -0800
committerGitHub <noreply@github.com>2023-11-24 09:35:46 +0100
commitddf673b36dd43e5ca60189a117c25ad6f55457e7 (patch)
tree44914623bba17a1d3604694906457e1c2675ebf3 /plugins
parent76a1dfcf2b5365e966bbc75749d9ced985c2d674 (diff)
downloadzsh-ddf673b36dd43e5ca60189a117c25ad6f55457e7.tar.gz
zsh-ddf673b36dd43e5ca60189a117c25ad6f55457e7.tar.bz2
zsh-ddf673b36dd43e5ca60189a117c25ad6f55457e7.zip
fix(python): set `py` alias if `py` is not installed (#12059)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/python/README.md2
-rw-r--r--plugins/python/python.plugin.zsh4
2 files changed, 3 insertions, 3 deletions
diff --git a/plugins/python/README.md b/plugins/python/README.md
index 97c1a34ee..7bf1b34ac 100644
--- a/plugins/python/README.md
+++ b/plugins/python/README.md
@@ -12,7 +12,7 @@ plugins=(... python)
| Command | Description |
| ---------------- | -------------------------------------------------------------------------------------- |
-| `py` | Runs `python3` |
+| `py` | Runs `python3`. Only set if `py` is not installed. |
| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv |
| `pyfind` | Finds .py files recursively in the current directory |
| `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one |
diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh
index 2fbb59577..3d7ca55c9 100644
--- a/plugins/python/python.plugin.zsh
+++ b/plugins/python/python.plugin.zsh
@@ -1,5 +1,5 @@
-# python command
-alias py='python3'
+# set python command if 'py' not installed
+builtin which py > /dev/null || alias py='python3'
# Find python file
alias pyfind='find . -name "*.py"'