Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python segment should check for the py launcher on Windows and display the version it runs #4923

Closed
1 task done
pfmoore opened this issue May 12, 2024 · 1 comment · Fixed by #4926
Closed
1 task done
Assignees
Labels
🚀 feat New feature

Comments

@pfmoore
Copy link

pfmoore commented May 12, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

What would you like to see changed/added?

On Windows, the default Python installation does not put python.exe on PATH, but instead installs the Python launcher py.exe. This runs Python for the user, handling the job of finding the latest Python version installed.

When using the "python" segment with no virtual environment active, it shows "NO VERSION" in this situation, which is technically accurate (running the command python won't work) but not actually useful (I want to know what version the py command will run).

Could this segment be updated to fall back to checking if py.exe is on PATH, and if so, reporting the Python version that it will run?

Alternatively, could the segment add a configuration to set the list of Python executables to check? This is what starship does, and I set it to look for ["python", "py"] - which gives the result I want.

@pfmoore
Copy link
Author

pfmoore commented May 13, 2024

Awesome! Thank you for the very fast response 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feat New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants