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

Suppress python version number when virtual environment is active #4624

Open
geozeke opened this issue Nov 18, 2022 · 3 comments
Open

Suppress python version number when virtual environment is active #4624

geozeke opened this issue Nov 18, 2022 · 3 comments
Labels
✨ enhancement A new feature implementation.

Comments

@geozeke
Copy link

geozeke commented Nov 18, 2022

Feature Request

Is your feature request related to a problem? Please describe.

Starship is awesome! Thanks! This is not related to a problem.

Describe the solution you'd like

When activating a python virtual environment created locally, Starship awesomely reaches back to the project directory for the name of the virtualenv in the prompt, rather than just calling it .venv. For example, it correctly looks like this (note, I intentionally rearranged the order of my prompt to put the virtualenv first):

image

I couldn't find it in the documentation or issues list, but I'd like to suppress the version number after the name of the virtualenv. In my example, the virtualenv would just be (notebooks)

image

Describe alternatives you've considered

Maybe a way to tweak the virtualenv variable in the format option of the python module?

@geozeke geozeke added the ✨ enhancement A new feature implementation. label Nov 18, 2022
@bishakh17
Copy link

Why would you want that, isn't it better if you know the python version your environment is using? i get that you can just use python --version but still.

@geozeke
Copy link
Author

geozeke commented Dec 1, 2022

Just a preference. I run multiple virtual environments, but usually only one version of Python (only occasionally use pyenv).

The version number in the prompt seems to be only triggered by a virtual environment called .venv. If I create a virtual environment with another name, and activate it, the name shows up in the prompt, but the version number doesn't.

@mtalexan
Copy link

Just a preference. I run multiple virtual environments, but usually only one version of Python (only occasionally use pyenv).

The version number in the prompt seems to be only triggered by a virtual environment called .venv. If I create a virtual environment with another name, and activate it, the name shows up in the prompt, but the version number doesn't.

What's the full name of your venv when you're "not using .venv"? If it's auto generated for you by a tool, there's a good chance the venv name itself contains the python version and that's what you're seeing.

Can you show the config of your [python] section?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement A new feature implementation.
Projects
None yet
Development

No branches or pull requests

3 participants