github / github/copilot-cli

Copilot CLI uses Unix-only commands on Windows

Ouverte
#2,981 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
area:platform-windows area:tools
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

While running on Windows PowerShell, Copilot piped output to `head -900`, a Unix command that does not exist in PowerShell. The command failed with: "The term 'head' is not recognized as a name of a cmdlet, function, script file, or executable program." Copilot had access to the environment context indicating Windows_NT as the OS, yet still generated a Unix-style command. The equivalent PowerShell would be `Select-Object -First 900`

### Affected version

GitHub Copilot CLI 1.0.36

### Steps to reproduce the behavior

Repro Steps:
1. Open Copilot CLI on a Windows machine running PowerShell 7
2. Provide a task that involves processing a large file (e.g., a 1.8MB
JSON file over 150 records
3. Ask Copilot to extract and display a subset of the data
4. Observe the generated shell command.

### Expected behavior

Copilot should detect the OS, Windows_NT is provided in environment, and use PowerShell commands. For example, to limit output to 900 lines, it should something along the lines of: `| Select-Object -First 900`

Instead, Copilot generated the command: `python -c "..." 2>&1 | head -900`

This failed with:"The term 'head' is not recognized as a name of a cmdlet, function, script file, or executable program."

### Additional context

_No response_

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.