github / github/copilot-cli

Copilot-cli changes all files it touches to have CRLF line endings even when the original file has LF line endings

Ouverte
#1,148 7 commentaires 8 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

1. Have any file with LF line endings.
2. Do any prompt that gets copilot to edit the file
3. The file has been changed to CRLF line endings

### Affected version

0.0.395 Commit: 4b4fe6e

### Steps to reproduce the behavior

```
PS C:\Dev\vcpkg-tool> copilot
╭──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ╭─╮╭─╮ │
│ ╰─╯╰─╯ GitHub Copilot v0.0.395 │
│ █ ▘▝ █ Describe a task to get started. │ Copilot uses AI, so always check for mistakes. │
│ ▔▔▔▔ │
│ Pick a model with /model. Delegate changes with an AI-generated PR using /delegate. │
│ Enter ? to see all commands. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯

❯ In @src\vcpkg.cpp under `#include ` add a comment describing why this header is included.

✓ Read src\vcpkg.cpp lines 1-160
└ 164 lines read

✓ Edit src\vcpkg.cpp

● Comment added above cgroup-parser include explaining its use for container detection.

Total usage est: 1 Premium request
API time spent: 7s
Total session time: 51s
Total code changes: +0 -0
Breakdown by AI model:
gpt-5.1-codex-max 40.9k in, 384 out, 19.3k cached (Est. 1 Premium request)

Resume this session with copilot --resume=2e8f3876-d7d5-430d-86f6-2b2ef57e1717
```

Now src\vcpkg.cpp got changed to CRLF line endings.

My `.gitattributes` is:

```
cat .\.gitattributes
# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
ce/pnpm-lock.yaml merge=binary
ce/shrinkwrap.yaml merge=binary
ce/npm-shrinkwrap.json merge=binary

# Disable line ending smudges entirely.
* -text

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/Microsoft/web-build-tools/issues/1088
#
*.json linguist-language=JSON-with-Comments
*.png binary
*.gif binary
*.mp4 binary
```

### Expected behavior

The file that started with LF line endings keeps LF line endings.

### 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.