-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the bug
In a VS Code window opened on a Git worktree, I'm getting a permissions error when trying to commit staged changes. The error message is:
[0204/181621.495272:ERROR:electron/shell/app/node_main.cc:146] Node.js environment variables are disabled because this process is invoked by other apps.
fatal: Unable to create '/Users/cv/Documents/Projects/GEO-Skunkworks/geo-experiments-new/.git/worktrees/exp-azure-hosted-agent-claude-code/index.lock': Operation not permitted
This prevents committing from that window. The files are already staged, and committing from the terminal outside VS Code works as expected.
Affected version
No response
Steps to reproduce the behavior
- Open a VS Code window on a Git worktree (not the main repo).
- Stage changes to files in the worktree.
- Attempt to commit using the built-in Git tools in VS Code or via the integrated terminal.
- Observe the error:
[0204/181621.495272:ERROR:electron/shell/app/node_main.cc:146] Node.js environment variables are disabled because this process is invoked by other apps.
fatal: Unable to create '/path/to/.git/worktrees/worktree-name/index.lock': Operation not permitted
Expected behavior
I expected to be able to commit staged changes from the VS Code window on the worktree without permission errors, similar to committing from the main repo or an external terminal.
Additional context
- macOS
- VS Code, using built-in Git support
- Problem occurs only in worktrees
- External terminal can commit successfully
- Error mentions Electron, possibly points to a Node.js/electron/VSC sandbox issue
- Path permissions appear correct
- No visible lock files blocking the process
Reactions are currently unavailable