Launching VS Code from Copilot CLI drops empty GIT_CONFIG_VALUE and breaks Git discovery
Personne n'a encore pris cette issue.
- 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
Copilot CLI exports an indexed GIT_CONFIG_COUNT / GIT_CONFIG_KEY_* / GIT_CONFIG_VALUE_* block into shell-command child processes. The core.fsmonitor override is represented by an empty value.
When VS Code is launched from the Copilot CLI environment with code ., VS Code's Git extension retains GIT_CONFIG_COUNT=4 and GIT_CONFIG_KEY_3=core.fsmonitor, but GIT_CONFIG_VALUE_3 is absent. Every Git command then fails before repository discovery:
error: missing config value GIT_CONFIG_VALUE_3
fatal: unable to parse command-line config
The Source Control pane consequently does not recognize the directory as a Git repository.
Affected version
GitHub Copilot CLI 1.0.81-3
Steps to reproduce the behavior
-
Start Copilot CLI on Windows in a Git repository.
-
Launch VS Code from the CLI environment:
code . -
Open the Source Control pane or inspect the VS Code Git log.
-
Observe repository discovery failing, for example:
> git rev-parse --show-toplevel error: missing config value GIT_CONFIG_VALUE_3 fatal: unable to parse command-line config
The relevant environment inherited from Copilot CLI is:
GIT_CONFIG_COUNT=4
GIT_CONFIG_KEY_0=safe.bareRepository
GIT_CONFIG_VALUE_0=explicit
GIT_CONFIG_KEY_1=safe.bareRepository
GIT_CONFIG_VALUE_1=explicit
GIT_CONFIG_KEY_2=credential.interactive
GIT_CONFIG_VALUE_2=never
GIT_CONFIG_KEY_3=core.fsmonitor
GIT_CONFIG_VALUE_3=<empty>
Git works directly in the Copilot shell because the empty variable is still present and resolves as core.fsmonitor=false. Clearing the injected block before launching VS Code avoids the failure:
Get-ChildItem Env:GIT_CONFIG_* | Remove-Item
code --new-window .
Expected behavior
Programs launched from Copilot CLI should be able to run Git normally. Internal Git hardening overrides should either be scoped to Copilot's own Git subprocesses, use a non-empty value such as core.fsmonitor=false, or otherwise remain a complete valid indexed block in child applications.
Additional context
- OS: Windows NT 10.0.26200.0, x64
- PowerShell: 7.6.5
- VS Code: 1.134.0, x64
- Git: 2.55.0.windows.3
- Copilot CLI's
safe.bareRepository=explicithardening is intentional; the failure is specifically the process-wide propagation of an empty indexed value into a GUI child process.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Aucun fichier du dépôt ni aucun test n’est nommé dans le rapport. Commencez par reproduire le lancement Windows de code . et suivre l’endroit où Copilot CLI construit et exporte l’environnement GIT_CONFIG_* indexé ; comparez-le à l’exécution directe de Git. Le travail est considéré comme terminé lorsque les applications enfants reçoivent un bloc complet et valide, ou aucun bloc à l’échelle du processus, et que git rev-parse --show-toplevel réussit dans VS Code.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- git, shell, vscode
- Domaine
- cli, devtools
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- Active
- Clarté
- Plutôt claire
- Accessibilité débutants
- 58/100