-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
experiment 'pythonTerminalEnvVarActivation' not working because shell integration is not working #22418
Comments
If none of these work, we would further need the debug logs to diagnose the issue:
Output for
|
Here are screenshots: No change when switching to pre-release version. Log:
|
I see, let me look deeper into it. Meanwhile, is changing the policy even for just the current user not an option?
Also, I assume
|
It seems conda executable is not on
Can you print |
When it is working (
as well as the variable When it is not working ( I do not have |
No it is not, the organization sets this policy and will not change it. Would VSCode be able to pass |
Issue arises from the fact that we're not able to reliably figure out whether Shell integration is working or not. In this case, it boils down to reliably finding out whether Powershell execution is restricted, can you run the following command on your system:
I'm expecting it would result in |
Yes, PowerShell ExecutionPolicy is |
Yes, that's not something we currently control, Python extension does not have it's own profile, we just use the selected one. I've created #22439 to make sure we solve your issue. Where we will more generally work on a way to figure out whether shell integration is working, rather than just checking the powershell execution policy. |
Btw, the issue is your case was here: vscode-python/src/client/terminals/envCollectionActivation/service.ts Lines 343 to 356 in cc38abb
|
Type: Bug
The experiment
'pythonTerminalEnvVarActivation'
does not work when"terminal.integrated.shellIntegration.enabled": true
and the user's PowerShell ExecutionPolicy isRestricted
. This experiment was originally touted as a way to get around theconda init powershell
issues which required users to elevate their ExecutionPolicy, but it seems to be only a partial fix.Current solution: set
"terminal.integrated.shellIntegration.enabled": false
. The display does not show currently activate environment etc. but everything seems to working correctly.Note: elevating the user's ExecutionPolicy is not a viable solution as organizations may not allow that.
Extension version: 2023.20.0
VS Code version: Code 1.84.0 (d037ac076cee195194f93ce6fe2bdfe2969cc82d, 2023-11-01T11:29:04.398Z)
OS version: Windows_NT x64 10.0.19044
Modes:
System Info
canvas_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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: