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

Prompt being overwritten, leading to cwd being removed when venv is activated by the extension #22150

Closed
brettcannon opened this issue Oct 4, 2023 Discussed in #22148 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team

Comments

@brettcannon
Copy link
Member

Discussed in #22148

Originally posted by realratchet October 4, 2023
Hello,

I've been using ~6 month old vscode (1.76.2) until recently recently, when decided to update it to 1.81.1 (because 1.82 has broken sourcemap reloading) and noticed that python extension has started hiding CWD in the terminal when it activates it. I've tried looking any references to it in json/discussion/tickets but any keywords I could think off of didn't find anything useful.

Here's an example of no venv activated
image

Here's an example when venv is activated manually
image

Here's an example when venv is activated by the extension
image

Is there a way to disable it, I've been using this for 3 days now and I'm at my breaking point to where I permanently switch to 1.76.2. I can't seem to find any user config that disables this behaviour. I know that it shows the current directory near the terminal icon but it's way out of place because you actually have to move your focus and even then it doesn't show full path if you're dealing with directory tree that has directories with same name.

Thanks.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 4, 2023
@brettcannon
Copy link
Member Author

This is a bug probably due to us attempting to add the virtual environment name to your shell prompt.

You can turn off environment activation via "python.terminal.activateEnvironment": false to work around the issue.

@karrtikr
Copy link

karrtikr commented Oct 4, 2023

@realratchet You're probably using an older version of Python extension which had this bug. Can you switch to the pre-release version of the extension on the latest version of VS Code?

image

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 4, 2023
@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Oct 4, 2023
@karrtikr
Copy link

karrtikr commented Oct 4, 2023

Also, you'll probably need to switch to latest version of VS Code.

If you decide you do not want to go this way, you can disable the experiment until you're ready to upgrade:

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

@realratchet
Copy link

Also, you'll probably need to switch to latest version of VS Code.

If you decide you do not want to go this way, you can disable the experiment until you're ready to upgrade:

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

Switching to pre-release and toggling pythonTerminalEnvVarActivation flag on/off is seems to have resolved it. However, using release version alone and doing the same didn't. The release version on my vscode is v2023.16.0 pre-release is v2023.15.12301911.

This works for me.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 5, 2023
@karrtikr
Copy link

karrtikr commented Oct 5, 2023

That's great, we plan release to the fix in the release version officially this week.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale Oct 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants