-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
pwsh prompt is clutted with unexpected env output #237900
Comments
Hello, Do you need some more info on this bug ? a video ? do not hesitate |
@anthonykim1, I think this is related to your work? |
Hello Anthony, Yes, I’m using VSCode at work, and I like to use the Insiders version to test the latest Copilot releases. By the way, it’s now almost impossible to use a PowerShell terminal. I can temporarily "repair" the prompt using this snippet in the command line:
However, after running or debugging my Python code, the prompt sometimes becomes corrupted again. I tried editing my profile to add this snippet, but the issue persists. I’m really stuck with this.. |
Hi @skeletozaure Thanks for filing this issue, and sorry you are running into this. I would appreciate video on this. Also wondering if setting I feel like this may be coming from because the new shell env api failed to escape some particular string in your environment variables, but it is not really possible to tell exactly where it failed parsing since the variables seems anonymized. See: https://github.com/anthonykim1/vscode/blob/949fbec0282822dd11e13fb8e88336fe5f846365/src/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1#L98 |
Hi @anthonykim1, Thank you for your help with this issue! I’ve attached a video to provide more context on how the problem occurs: As shown in the video, I tried setting terminal.integrated.shellIntegration.enabled to false. This resolved the issue; however, I noticed that my Conda virtual environment no longer activates automatically when I open the terminal. So It’s possible that this behavior is related to the virtual env activation. Thanks for pointing me to shellIntegration.ps1—I’ll take a closer look at it and see if I can identify any further details. Please let me know if there’s anything else I should investigate or clarify. Best regards, |
What happens if you set the |
Hello @anthonykim1 . As i use conda for my virtual env, even if i don't have a virtual environment assigned to the workspace, (base) environment is assigned by default when i open powershell terminal. BTW i don't have any problem with (base) env whatever i use in |
@skeletozaure I see, Do you mind pasting the output when you type vscode/src/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1 Lines 94 to 99 in 33f9460
on your output. Having the output of Thanks! |
Hi @anthonykim1, Here is the result in my pwshell term
Also i have debugged the function Global:Prompt() to get $Result, i have replace \x5c by \ to make it more readable :
Hope this help cya |
Type: Bug
I'm using Miniconda to manage my Python Virtual Environments, each time i open a Terminal (powershell), i have junk ansi text written after the virtual environnement selected. It has begun some days ago.
I have reinstalled VSCode insiders, and all the extensions (from bare metal), and same issue each time. Same issue on all of my virtual env
Step to reproduce :
Exemple of Junk Data (anonymized) :
(Sandbox) rs\x5c\x5c[myUSer]\x5c\x5cOneDrive - [myCompany]\x5c\x5cDocuments\x5c\x5cWindowsPowerShell\x5c\x5cModules\x3bC:\x5c\x5cProgram Files\x5c\x5cWindowsPowerShell\x5c\x5cModules\x3bC:\x5c\x5cWINDOWS\x5c\x5csystem32\x5c\x5cWindowsPowerShell\x5c\x5cv1.0\x5c\x5cModules","SSL_CERT_DIR":"C:\x5c\x5cUsers\x5c\x5c[myUSer]\x5c\x5cAppData\x5c\x5cLocal\x5c\x5cminiconda3\x5c\x5cenvs\x5c\x5cSandbox\x5c\x5cLibrary\x5c\x5cssl\x5c\x5ccerts","SNC_LIB_64":"C:\x5c\x5cProgram Files\x5c\x5cSAP\x5c\x5cFrontEnd\x5c\x5cSecureLogin\x5c\x5clib\x5c\x5csapcrypto.dll","CONDA_PREFIX_2":"C:\x5c\x5cUsers\x5c\x5c[myUSer]\x5c\x5cAppData\x5c\x5cLocal\x5c\x5cminiconda3\x5c\x5cenvs\x5c\x5cSandbox","ProgramFiles(x86)":"C:\x5c\x5cProgram Files (x86)","HOMEDRIVE":"C:","OS":"Windows_NT","PUBLIC":"C:\x5c\x5cUsers\x5c\x5cPublic","OneDrive":"C:\x5c\x5cUsers\x5c\x5c[myUSer]\x5c\x5cOneDrive - [myCompany]","VSCODE_GIT_IPC_HANDLE":"\x5c\x5c\x5c\x5c.\x5c\x5cpipe\x5c\x5cvscode-git-ca0238292a-sock","VSCODE_GIT_ASKPASS_EXTRA_ARGS":""};dba6be80-468f-423d-90bf-3bb14c89bd5bPS L:\TFS\PY_FOS\exportPRODEC>
=> Also i can add that with the same Virtual Env, i don't have any problem with regular VSCode
=> No problem if i open a cmd terminal
Thanks for your help
VS Code version: Code - Insiders 1.97.0-insider (c594d55, 2025-01-14T05:04:07.371Z)
OS version: Windows_NT x64 10.0.19045
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Extensions (55)
(1 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: