3

I am not asking about PowerShell syntax itself.

The PowerShell command shown below is executed internally by a VS Code extension

(Kilo Code) as part of its environment detection. The command itself works

correctly when run manually.

The actual problem is that the extension fails when invoking Git on Windows.

It appears to construct the Git executable path incorrectly when Git is installed

under "Program Files", causing the path to be split and interpreted as arguments.

When running an AI extension (Kilo Code) inside VS Code, it fails immediately with the following error:

Command failed with exit code 1:
powershell (Get-CimInstance -ClassName Win32_OperatingSystem).caption
git: 'Files\Git\cmd\git.exe' is not a git command. See 'git --help'.

From the error it looks like Git is being invoked incorrectly, as if "C:\Program Files\Git\cmd\git.exe" was split and executed as:

git Files\Git\cmd\git.exe

Environment

  • OS: Windows 10 / Windows 11 (native)
  • VS Code: Microsoft VS Code (stable)
  • Git version: git version 2.52.0.windows.1
  • Git location: C:\Program Files\Git\cmd\git.exe

What works

Git works perfectly in terminal:

git --version
where.exe git

returns correct results.

I also confirmed that PowerShell itself works:

(Get-CimInstance -ClassName Win32_OperatingSystem).caption

What I already tried

  • Set VS Code setting: "git.path": "C:\Progra~1\Git\cmd\git.exe"
  • Created a no-space Git wrapper: C:\Git\cmd\git.cmd which calls: "C:\Program Files\Git\cmd\git.exe" %*
  • Added C:\Git\cmd to the beginning of PATH
  • Verified with: where.exe git Get-Command git
  • Restarted VS Code completely
  • Cleared VS Code extension cache (globalStorage)
  • Created new tasks (no resume)
  • Verified VS Code CLI: Get-Command code -> code.cmd from VS Code installation

Despite all of this, the extension still reports:

git: 'Files\Git\cmd\git.exe' is not a git command

Question

Is this a known issue with Node.js / VS Code extensions incorrectly handling paths with spaces on Windows?

Is there any way to force a VS Code extension to use the Git executable from PATH (or a custom git path) instead of hardcoding %ProgramFiles%\Git\cmd\git.exe?

Or is the only solution to run the extension in WSL / wait for an extension fix?

Any insight would be appreciated.

3CEZVQ
43.7k11 gold badges93 silver badges103 bronze badges
asked Dec 23, 2025 at 5:12
4
  • 1
    What you have shown is a story and is not debugging details. We would like to see configuration files of Kilo Code. Commented Dec 23, 2025 at 6:20
  • 1
    I think the extension have executed wrong git path. Commented Dec 23, 2025 at 6:31
  • ### Kilo Code configuration Kilo Code does not use a separate configuration file. All configuration is stored in VS Code settings.json. Relevant settings from my environment: ```json { "git.path": "C:\\Git\\cmd\\git.cmd", "kilo-code.gitPath": "C:\\Git\\cmd\\git.cmd", "kilo-code.allowedCommands": [ "git log", "git diff", "git show" ], "kilo-code.deniedCommands": [] } Commented Dec 23, 2025 at 7:06
  • Note that git.exe is clearly discoverable and executed, given that it is Git itself that reports the error. The mystery is why Files\Git\cmd\git.exe is being passed as an argument to the Git call. Commented Dec 23, 2025 at 13:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.