Incorrect line-endings on new files

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

For the last week or so all new files generated by the agent have CRLF instead of LF line-endings. I have had the agent investigate this (both Opus and GPT) and they have both concluded that it is not a configuration issue. This also happens with cursor-cli.

(I have to convert line endings manually because bash scripts do not run correctly with CRLF on macOS)

Opus 4.6 conclusion:

"OK, so here’s the full picture. Every relevant setting is configured for LF:

Setting Value Would cause CRLF?
files.eol (Cursor user settings) “\n” (LF) No
.gitattributes *.py text eol=lf No
.editorconfig Not present N/A
.vscode/settings.json No eol setting N/A
.cursor/settings.json Not present N/A
core.autocrlf (global/local/system) Not set No
core.eol Not set No

Your configuration is all correct for LF. The CRLF is being introduced by Cursor’s AI agent file-writing tools themselves. When the agent creates or writes a file via its internal Write/StrReplace tools, the content passes through an API layer that appears to use CRLF line endings regardless of your files.eol setting. This is a known Cursor bug/behavior — the agent tooling doesn’t honour the editor’s EOL preference when writing files."

Steps to Reproduce

Configure your environment for LF line-endings and ask the agent to create a hello world python app.

Expected Behavior

It should generate files with LF line-endings when the IDE is configured for it.

Operating System

MacOS

Version Information

Version: 2.4.28
VSCode Version: 1.105.1
Commit: f3f5cec40024283013878b50c4f9be4002e0b580
Date: 2026-02-03T00:56:18.293Z
Build Type: Stable
Release Track: Default
Electron: 39.2.7
Chromium: 142.0.7444.235
Node.js: 22.21.1
V8: 14.2.231.21-electron.0
OS: Darwin arm64 21.6.0

For AI issues: which model did you use?

Opus 4.6 thinking, GPT-5.2 High thinking

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the report. You did a great job investigating, and yep, all the configs are correct.

This is a bug on the agent tooling side. When it writes files, it doesn’t respect the files.eol setting. We’ve seen a few similar reports about line endings lately, so the team is aware of this kind of issue.

For now, the workaround is to convert manually with dos2unix, or set up a Git hook. core.autocrlf won’t help on macOS, but you can add a pre-commit hook.

I’ll pass this to the team. Your report will help with prioritization.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.