Closed andyshinn closed 1 day ago
Hello, Thank you for filing this issue. There has already been discussion around this: https://github.com/microsoft/vscode-python/issues/23304 and https://github.com/microsoft/vscode-python/issues/23137
Are you able to post:
It would be great if you can share contents inside your ~/.zshrc I want to see what is changing your PS1.
To help diagnose the issue, could you also further share:
Developer: Set log level
commandTrace
Developer: Reload Window
commandPython
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
``` XXX ```
@andyshinn Also when you say previously, do you mean in terminal instance outside of VS Code?
I meant that this wasn't a problem in previous weeks. It started happening after a recent VS Code or Python extension update.
Apologies for late response and thanks again for this detailed log here. We've had very similar issue: Give this a read: https://github.com/microsoft/vscode-python/issues/23137.
Way to resolve this would be https://github.com/microsoft/vscode-python/issues/23159 so please feel free to go give a thumbs up. This is the limitation we currently have with the new terminal env variable activation since we do not have context of user's shell initialization file, it should be resolved once https://github.com/microsoft/vscode-python/issues/23159 is taken care of. Lets track the issue there but let me know if you have any other questions. Thanks.
Type: Bug
Behaviour
I use the Starship shell integration with zsh on macOS. A recent version of this Python extension seems to not play nicely with it or has started prepending
(.venv)
toPS1
where it wasn't previously.The logs for the Python extension show:
I didn't see any option to disable it. My shell now gets a new line added to it when
(.venv)
gets activated even though Starship already handles this:Previously it would be:
Screenshot example:
Steps to reproduce:
.venv
already created..venv
addon activated.Diagnostic data
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)``` 2024-07-03 12:19:51.032 [info] Setting environment variable INFLUX_URL in collection to http://localhost:8086 {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-03 12:19:51.032 [info] Setting environment variable MANPATH in collection to /opt/homebrew/share/man:: {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-03 12:19:51.032 [info] Prepending environment variable PATH in collection with /Users/andy/.vscode/extensions/ms-python.python-2024.8.1/python_files/deactivate/zsh:/Users/andy/GitHub/andyshinn/bridger/.venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-03 12:19:51.032 [info] Setting environment variable VIRTUAL_ENV in collection to /Users/andy/GitHub/andyshinn/bridger/.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-03 12:19:51.032 [info] Prepending environment variable PS1 in collection with (.venv) {"applyAtShellIntegration":true,"applyAtProcessCreation":false} 2024-07-03 12:19:51.032 [info] Setting environment variable VIRTUAL_ENV_PROMPT in collection to (.venv) {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-07-03 12:19:51.033 [info] Send text to terminal: /usr/bin/python3 /Users/andy/.vscode/extensions/ms-python.python-2024.8.1/python_files/printEnvVariablesToFile.py /Users/andy/.vscode/extensions/ms-python.python-2024.8.1/python_files/deactivate/zsh/envVars.txt 2024-07-03 12:19:51.867 [info] Starting Pylance language server. ```
Extension version: 2024.8.1 VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:53:23.353Z) OS version: Darwin arm64 23.5.0 Modes:
python.languageServer
setting: DefaultUser Settings
``` venvFolders: ""
languageServer: "Pylance"
```
Installed Extensions
|Extension Name|Extension Id|Version| |---|---|---| |Astro|astro-build.astro-vscode|2.10.2| |Azure Repos|ms-vscode.azure-repos|0.38.0| |Black Formatter|ms-python.black-formatter|2024.2.0| |C/C++|ms-vscode.cpptools|1.20.5| |Dev Containers|ms-vscode-remote.remote-containers|0.369.0| |Docker|ms-azuretools.vscode-docker|1.29.1| |Flake8|ms-python.flake8|2023.10.0| |GitHub Actions|github.vscode-github-actions|0.26.3| |GitHub Copilot|GitHub.copilot|1.209.0| |GitHub Copilot Chat|GitHub.copilot-chat|0.16.1| |GitHub Pull Requests|GitHub.vscode-pull-request-github|0.90.0| |GitHub Repositories|GitHub.remotehub|0.62.0| |HashiCorp Terraform|hashicorp.terraform|2.31.0| |isort|ms-python.isort|2023.10.1| |JavaScript Debugger|ms-vscode.js-debug|1.91.0| |JavaScript Debugger Companion Extension|ms-vscode.js-debug-companion|1.1.2| |Live Preview|ms-vscode.live-server|0.4.13| |PHP Intelephense|bmewburn.vscode-intelephense-client|1.10.4| |Pylance|ms-python.vscode-pylance|2024.6.1| |Python|ms-python.python|2024.8.1| |Python Debugger|ms-python.debugpy|2024.6.0| |Remote - SSH|ms-vscode-remote.remote-ssh|0.112.0| |Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|0.86.0| |Remote - Tunnels|ms-vscode.remote-server|1.5.2| |Remote Development|ms-vscode-remote.vscode-remote-extensionpack|0.25.0| |Remote Explorer|ms-vscode.remote-explorer|0.4.3| |Remote Repositories|ms-vscode.remote-repositories|0.40.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9| |WSL|ms-vscode-remote.remote-wsl|0.88.2|System Info
|Item|Value| |---|---| |CPUs|Apple M2 Ultra (24 x 2400)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|3, 3, 3| |Memory (System)|64.00GB (1.07GB free)| |Process Argv|--crash-reporter-id 2143d587-324d-4715-b992-cd833039eaea| |Screen Reader|no| |VM|0%|
A/B Experiments
``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 vscrp:30673768 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonnoceb:30805159 asynctok:30898717 pythonregdiag2:30936856 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 jchc7451:31067544 chatpanelt:31048053 dsvsc021:30996838 da93g388:31013173 pythoncenvpt:31062603 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 2f103344:31071589 impr_priority:31082723 ```