WSL - source control commit using wrong shell

System: Windows 11 / WSL2 - ubuntu

Version: 1.7.28 (user setup)
VSCode Version: 1.99.3
Commit: adb0f9e3e4f184bba7f3fa6dbfd72ad0ebb8cfd0
Date: 2025-10-01T02:45:21.769Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

I am using cursor inside wsl and from some time commit button in “source control” throws errors. Commit from inside built-in terminal works. Commit using “commit button” throws for eg:

git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
.husky/pre-commit: 1: pnpm: not found
husky - pre-commit script failed (code 127)
husky - command not found in PATH...

of course everything is installed and as i said before it works from within builtin terminal. It looks like “source control” now uses different shell.

1 Like

I have the same issue.

VSCode 1.106.2 is working fine, but not in Cursor 2.1.46 (VSCode 1.105.1).

I’m using fnm and when inspecting PATH, I notice that when running by Cursor, the `eval "$(fnm env --use-on-cd --shell zsh)"in ~/.zshrcis not executed, thus the path of the matching Node.JS version it not added.

That’s why it fails with pnpm not found.

The path /run/user/1000/fnm_multishells/…id…/bin it has is also different than the one when I enter wsl from the terminal.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.