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

Add setting to disable prepending venv prompt to PS1 #24014

Closed
Riezebos opened this issue Aug 28, 2024 · 4 comments
Closed

Add setting to disable prepending venv prompt to PS1 #24014

Riezebos opened this issue Aug 28, 2024 · 4 comments
Assignees
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@Riezebos
Copy link

I am using Starship (https://starship.rs/) as prompt. When I run source .venv/bin/activate in a regular terminal, my prompt becomes:
image
but when vscode-python activates the env, the prompt becomes:
image

This is probably caused by this being part of the environment changes done by this extension: PS1=(.venv) ${env:PS1}

I could disable the "python.terminal.activateEnvironment" setting and activate the environment some other way, but I like it that this extension does that and would like to keep it that way.

Could an option be added to disable the PS1 change?

@Riezebos Riezebos added the feature-request Request for new features or functionality label Aug 28, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Aug 28, 2024
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug and removed feature-request Request for new features or functionality labels Aug 28, 2024
@anthonykim1
Copy link

Hello @Riezebos Thanks for filing the issue here.

Are you able to add:

 "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"],

in your settings.json and see if you can repro the same problem?

@anthonykim1 anthonykim1 added area-terminal and removed triage-needed Needs assignment to the proper sub-team labels Aug 29, 2024
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Aug 29, 2024
@Riezebos
Copy link
Author

Thanks, that worked!

@HiddenDeveloper
Copy link

Thanks. I was having the same problem with the prompt being corrupted when the terminal was opened with the virtual environment. Using the "python.experiments.optOutFrom": ["pythonTerminalEnvVarActivation"] with the pre-release version of the extension fixed the issue. Cheers ...

@anthonykim1
Copy link

anthonykim1 commented Sep 1, 2024

Hi folks, we are trying to fix the root cause of this problem step by step: starting from: #23159 PR solely wont fix the problem but upcoming PR after #23159 is resolved will address PS1) There may have to be additional PR in addition to #23159 to specifically address PS1 issue. so you can enjoy all the benefits from the terminal env var activation experiment without getting incorrect PS1.
Opt out of the experiment for now, but I would be interested to have folks try the experiment when I merge changes for #23159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-terminal bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants