microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.18k stars 28.84k forks source link

VSCode Fails to Automatically Detect Git Path After Update to `1.94.0` #230481

Open BowTiedRadone opened 1 day ago

BowTiedRadone commented 1 day ago

Overview

After updating Visual Studio Code to version 1.94.0, VS Code no longer automatically detects the Git executable path, even though Git is installed and accessible through the system terminal. This issue requires manual configuration of the Git path in VS Code settings, which was not necessary in previous versions

Steps to Reproduce:

  1. Update VS Code to version 1.94.0.
  2. Ensure Git is installed and can be accessed via the terminal.
  3. Open a project that is a Git repository in VS Code.
  4. Navigate to the Source Control tab.
  5. The Source Control tab will prompt to Initialize repository or Publish to GitHub

Expected Behavior:

VS Code should automatically detect the Git path and allow interaction with the repository without manually configuring the git.path setting.

Actual Behavior:

VS Code prompts to initialize a Git repository even when a valid .git folder is present. The issue is resolved only by manually setting the Git path via Code > Settings > Settings > Git: Path.

Workaround:

Manually setting the Git path to the location of the Git executable (git.path) in the VS Code settings resolves the issue.

Environment:

VS Code Version: 1.94.0 OS: macOS Sonoma 14.6.1 Git Version: 2.45.2 (Installed via Homebrew)

lszomoru commented 1 day ago

@BowTiedRadone, after the update when VS Code started did you receive any notification that the "environment" could not be loaded? There is a known issues that results in the environment not getting loaded after an update. Could you try closing all instances of VS Code and launching it again?

BowTiedRadone commented 1 day ago

Hi @lszomoru, I don’t recall receiving any notification related to this issue. I tried restarting all instances of VS Code, but that didn’t resolve the problem. The only fix was manually specifying the Git path. Interestingly, the issue does not occur when using VS Code to SSH into an Ubuntu VM - Git is automatically detected there.

lszomoru commented 1 day ago

@bpasero, are there any logs to troubleshoot loading the shell environment? Thanks!

bpasero commented 1 day ago

Yeah just run with --verbose and check the main log for entries resolveShellEnv...

lszomoru commented 3 minutes ago

@BowTiedRadone, could you please try the flag from this comment and share the logs? Thanks!