vscode
vscode copied to clipboard
launching vscode and shows "Unable to resolve your shell environment“
Hi ! I have a problem that I can't solve and would like to seek help or report the issue.
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.101.0
- OS Version: 10.0.26100
Version: 1.101.0 (system setup) Commit: dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1 Date: 2025-06-11T15:00:50.123Z Electron: 35.5.1 ElectronBuildId: 11727614 Chromium: 134.0.6998.205 Node.js: 22.15.1 V8: 13.4.114.21-electron.0 OS: Windows_NT x64 10.0.26100
Steps to Reproduce:
- open the latest vscode in win11 24H2 26100.4351
- popup notification in the bottom right corner : "Unable to resolve your shell environment: Unexpected exit code from spawned shell (code 3762504530, signal null)"
I tried reinstalling, but this warning still pops up for both the user version and the admin version.
I set application.shellEnvironmentResolutionTimeout 120 , but it do not work.
However, I found that entering "code --verbose" in PowerShell opens VSCode without any warnings.
The uploaded .zip file is my log file, hoping it can be helpful.
I get a slightly different error message. Here is the output of main with log level set to trace.
I don't get the error with vscode --verbose either.
- Windows 11 24H2 26100.4351 x64
- VSCode v1.101.0 (user setup) x64
I get a slightly different error message. Here is the output of main with log level set to trace.我收到的错误消息略有不同。以下是 log level 设置为 trace 的 main 的输出。
I don't get the error with
vscode --verboseeither.我也没有收到vscode --verbose的错误。
- Windows 11 24H2 26100.4351 x64窗户 11 24H2 26100.4351 x64
- VSCode v1.101.0 (user setup) x64VSCode v1.101.0(用户设置)x64
Hi, thank you for your reply!
I saw a problem with the same error message as yours : #251326 .
In fact, I didn't have this error message before I updated VSCode and Windows 11 yesterday.
I have now found that if I install the April 2025 (version 1.100) of vscode, this error completely disappears.
This seems to be caused by the latest version.
I have rolled back to the previous version and hope the issues will be fixed in the next version.
Thank you again for your help!
I got this also, on Windows... when I clicked "Learn More" I got a help page that says "This section applies to macOS and Linux environments only." so definitely something wonky going on here :(
Not sure if it's related or not, but sine the same update, I'm also seeing CoPilot icons & prompts all over the place even though I don't have the CoPilot extensions installed & have as many of the chat enabled settings as I can find set to false
I use Git Bass as default shell on Windows. It also happens to me many times but not always and I have no clue how to fix it😭
After the upgrade to the:
I have errors like below:
I don't remember which version I upgraded from, but previously, there weren't such errors.
After installing "command not found" from PowerToys I have only that:
For me, only the latest version(1.101) will have the initial issue.
I saw the following changes in the update log of this version and guessed the possible reasons.
I also installed PowerToys, but no problems occurred.
Errors are only in VSCode, not in the terminal itself.
This bug stated affecting me immediately after the update 1.101.0
However I have found I can launch VSCode from the existing C:\Program Files\Microsoft VS Code\bin\code.cmd possibly relating to inheriting the environment from the CLI - as per documentation
The contents of file look rather innocuous.
@echo off
setlocal
set VSCODE_DEV=
set ELECTRON_RUN_AS_NODE=1
"%~dp0..\Code.exe" "%~dp0..\resources\app\out\cli.js" %*
IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%
endlocal
I have no idea if this is a viable workaround, I only know the error does not occur when I launch from this but the whatever symptoms may still persist.
Yes, I also found that if I open VSCode from cmd/powershell, there will be no error prompts.
Actually, even if there are error prompts, the terminal in VSCode can still be used normally.
My guess is the same as yours:
When opening VSCode, it fails to load the correct shell environment, whereas opening it from cmd automatically inherits the parent process's environment.
In my scenario, VSCode fails to resolve certain settings from my $PROFILE during startup. To handle this, I conditionally disable these settings when running in VSCode:
# Microsoft.PowerShell_profile.ps1
if (-not $env:VSCODE_PID) {
# These settings are skipped in VSCode as they aren't resolved properly during startup
$Host.UI.RawUI.WindowTitle = "pwsh.exe"
Import-Module -Name Microsoft.WinGet.CommandNotFound
}
This might have been caused by https://github.com/microsoft/vscode/issues/249130, passing to @connor4312
Some of your issues may already be fixed on VS Code Insiders. If they are not, please:
- Run "Configure Runtime Arguments" and set
"log-level": "trace" - Completely close VS code, including all Windows
- Open VS Code from your desktop or app browser (not a terminal)
- Go to Output > Main and share the logs with us
Interesting thing, after uninstalling the EntraID extension, it is better. I saw this error message only once. I'll observe the application behavior, and if the message pops up, I enable logging.
Funny fact: not always opening VSCode is starting "Resolving Shell Environment" or is so quick that I cannot notice. The first opening caused an error, closing VSCode, and opening it once again, but it did not show any errors. When you are doing it quickly. When you wait a few minutes, "Resolving Shell Environment" is showing longer, and an error is appearing.
@connor4312 How would you like me to send the logs?
You can post them here or email to [email protected]
Fixed in Insiders
Fixed in Insiders
Looks like it's fixed. Thank you @connor4312, great job 🥇