Codex CLI must respect Windows-style CRLF line endings

Resolved 💬 5 comments Opened Sep 28, 2025 by morganavr Closed Nov 12, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

I run Codex CLI in WSL on Windows 10 PC. My source code uses windows CRLF line endings but Codex changes files to Unix-style LF causing huge diffs.

Here's a typical Codex CLI text output:

I'm noticing the patch changed the file's line endings from Windows-style CRLF to Unix-style LF, causing a huge diff. To keep the repo consistent, I need to revert the file and reapply changes while preserving CRLF endings, probably by tweaking the patch or using a script to maintain line endings.

It would be nice if Code CLI could edit text with Windows-style CRLF from the start without correcting itself later.

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

5 Comments

nonlin · 11 months ago

This is happening to me on windows too. Discord states to use WSL on Windows but I don't think it would help?

morganavr · 11 months ago

Meanwhile I converted manually all .cs files to LF line ending style with this linux command:

ROOT="/mnt/f/_GITHUB/your_project"
find "$ROOT" -type f -iname "*.cs" -print0 | xargs -0 dos2unix -ic0 | xargs -0 -r dos2unix

Nenormalniy · 10 months ago

Yeah, this issue still persists and it is so annoying

devsmm · 10 months ago

+1 still having this issue.

etraut-openai contributor · 9 months ago

Closing in favor of #4003, which has more upvotes