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

venv appears reactivated even though it isn't #22825

Closed
sgjohnson1981 opened this issue Jan 30, 2024 · 9 comments
Closed

venv appears reactivated even though it isn't #22825

sgjohnson1981 opened this issue Jan 30, 2024 · 9 comments
Assignees
Labels
experimenting Feature is part of an experiment triage-needed Needs assignment to the proper sub-team

Comments

@sgjohnson1981
Copy link

sgjohnson1981 commented Jan 30, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.85.2
  • OS Version: Windows 10.0.19045

Steps to Reproduce:

  1. Have an activated python virtual environment created by venv in a cmd terminal.
  2. Restart the terminal (I had one of those warnings that it needed to be restarted).
  3. When the terminal restarts, the venv appears as though it's still activated (its name is in the parentheses before the working directory).
  4. Attempt to deactivate just using deactivate command.
  5. Receive a deprecation warning from conda stating to use "conda deactivate" instead, even though it's not a conda environment.
  6. Run echo %PATH% to see that order isn't correct for a venv environment.
  7. Reactivate environment.
  8. Run echo %PATH% again to see the directories in the correct order.
  9. Realize it must not have actually been activated.

My guess is this has to do with VS Code attempting to "restore terminal history." I think a user would expect either the environment to be reactivated or it to not appear as though it's reactivated.

@meganrogge meganrogge assigned karrtikr and unassigned meganrogge Jan 30, 2024
@karrtikr karrtikr added the triage-needed Needs assignment to the proper sub-team label Feb 1, 2024
@karrtikr karrtikr transferred this issue from microsoft/vscode Feb 1, 2024
@karrtikr karrtikr added the experimenting Feature is part of an experiment label Feb 1, 2024
@karrtikr
Copy link

karrtikr commented Feb 1, 2024

Thanks for the bug report! We investigate issues in order based on priority and severity, which includes the impact it has on your ability to use the extension to do productive work, and the number of people affected. If other users come forward and leave a comment demonstrating they are seeing/reproducing the problem then we will raise this issue's priority. Thanks for understanding and the patience!

@karrtikr
Copy link

karrtikr commented Feb 5, 2024

Please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 5, 2024
@karrtikr
Copy link

karrtikr commented Feb 8, 2024

A lot of these issues were recently fixed, try the latest pre-release and stable version of the Python extension.

image

@sgjohnson1981
Copy link
Author

sgjohnson1981 commented Feb 10, 2024

It seems the terminal history feature has been completely eliminated, even though it seems it still says "History restored." Not only is the venv name gone when I restart VS Code the working directory is also reset to my home directory. So what history is restored? It's definitely not the command history, which to be honest, would be a nice feature as well. (Btw, I didn't switch to pre-release python version.) @karrtikr

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Feb 10, 2024
@sgjohnson1981
Copy link
Author

I switched to Pre-Release. Seems to be working as far as I can tell. Not sure why no history at all was restored on that first restart.

@sgjohnson1981
Copy link
Author

Nevermind. Seems to be doing it again.

@karrtikr
Copy link

Hi, I've prepared an extension VSIX containing potential fix: https://github.com/microsoft/vscode-python/actions/runs/7853829284/artifacts/1235350371, please give it a try. You can install the VSIX using Extension: Install from VSIX command.

If it doesn't work, please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Feb 10, 2024
@brettcannon
Copy link
Member

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
@sgjohnson1981
Copy link
Author

Seems to be working now. Using 'where python' in the terminal has directories in the correct order.

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Mar 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
experimenting Feature is part of an experiment triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

4 participants