1

Initially I followed the instructions in this YouTube tutorial, where i was instructed to:

  • Install ESP-IDF

  • Install VS Code

  • create a workspace with the following code:

    "terminal.integrated.shell.windows": "cmd.exe",
        "terminal.integrated.shellArgs.windows": [
            "/k", 
            "C:/Coding/ESP32/esp-idf/export.bat"
        ],
    

    where I was warned with a deprecated message and got the:

    Error: The following tools are not installed in your environment.    git, 
    

I know git is installed, and also when I actually run esp-idf 5.0, I do not get this message. So I falsely assumed that it was because of the deprecation even though the message also informed me that it should currently still work. Nevertheless I changed it anyway, always good to stay ahead of problems.

After a Google search I found The new way to configure default shell and argument commands in VSCode?, which seems informative, and followed these answers. Nevertheless the error message remained. After another related search I found Git not installed in VSCode on MAC. Although this is on a Windows machine, the solution to reinstall git seemed plausible so that is what I did, made sure the link to git-bash.exe was correct.

But this I get this same message. During this process I have tried multiple versions of the code which most I got working except for the git not installed error.

Then I found
The terminal shell path "..\..\..\vsCode\git\bin\bash.exe" does not exist in VS Code Windows which appeared promising once again. Nevertheless the answers really confused me. Adding setting.json, which I found to be empty, and the difference in answers from Christina and the double slash issue really got me wondering.

Currently I am using the following code:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "terminal.integrated.profiles.windows": {
            "PowerShell": {
                "source": "PowerShell",
                "icon": "terminal-powershell"
            },
            "Command Prompt": {
                "path": [
                    "${env:windir}\\Sysnative\\cmd.exe",
                    "${env:windir}\\System32\\cmd.exe"
                ],
                "args": [
                    "/k", 
                    "C:/Espressif/frameworks/esp-idf-v5.0/export.bat"
                ],
                "icon": "terminal-cmd"
            },
            "Git Bash": {
                "path": [
                "C:/Program Files/Git/git-bash.exe"
            ],
                "source": "Git Bash"
            }
        },
        "terminal.integrated.defaultProfile.windows": "Command Prompt",
    }
}

and I have run out of options.

Does anyone have a clue why VS Code keeps seeing git not installed, while when I run the esp-idf smc it has no issue at all?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 2
    can you check your `PATH` ? for example: from VSCode, open an integrated shell (I assume you have set up `cmd.exe` by default ?) and run `path` or `echo %PATH%`. Check if you ave the path that leads to `git.exe` in the list of directories. – LeGEC Jan 09 '23 at 06:22
  • 2
    also: from a regular cmd.exe shell on your PC (not within VSCode), do you have access to `git` ? run for example `git version` – LeGEC Jan 09 '23 at 06:35
  • Hello LeGEC, thanks for you input. Oddly enough, upon opening VScode the problem had disappeared, it did asked me to install a few things and uninstall a couple of others. but the issue i had been dealing with. missing Git. was abcent and no all seems to work, withut me doing anything else then I already did, and yeah i did reboot the pc (several times) so to answer the question. yeas, the path to git is in the directories list (don't know if it was before, but it is now). And yeah I have access to git from CMD outside VScode but I did have that before. that is what i found odd. – Matthieu Kints van Jan 10 '23 at 00:03
  • So how it got solved, i do not know, never the less you help me find it out so the bounty is ofcourse yours. Thank you for putting in your time!! much appreciated! – Matthieu Kints van Jan 10 '23 at 00:05
  • unfortunatel, i can't seem to accept your comments as answer. I believe you need to put in an answer or something for me to be able to accept it. sorry. – Matthieu Kints van Jan 10 '23 at 00:09

1 Answers1

2

From your comments: it looks like the problem disappeared on its own.

An error indicating that "git can't be found" may point at a PATH problem.
A PATH issue would also be consistent with the following fact: your VSCode settings indicate how to open git-bash but there is no setting asking for an explicit path to git.

If this problem reappears, I would suggest to look at your PATH variable:

  • from within your running VSCode instance, open an integrated terminal, and depending on the shell that is started, run either path or echo %PATH% (if shell is cmd.exe or echo $PATH (if shell is git-bash),
    run git version to confirm whether you can run git or not

  • check the same elements from a terminal opened outside VSCode

Comparing these values may allow you to determine if your system misses some configuration, or if you should look into the scripts that are executed when you start VSCode.

LeGEC
  • 46,477
  • 5
  • 57
  • 104