github / github/copilot-cli

Permission denied error on worktree index.lock when committing from VS Code (Electron sandbox issue with git)

Ouverte
#1,301 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:permissions
Langage dominant
Shell
Étoiles
11.2k
Forks
1.9k
Merge moyen
14 h 16 min
PR mergées (30 j)
6

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

1. Open a VS Code window on a Git worktree (not the main repo).
2. Stage changes to files in the worktree.
3. Attempt to commit using the built-in Git tools in VS Code or via the integrated terminal.
4. 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

Screenshot showing error and terminal output

- 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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.