codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex CLI must respect Windows-style CRLF line endings

Open morganavr opened this issue 1 year ago • 5 comments

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

morganavr avatar Sep 28 '25 13:09 morganavr

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

nonlin avatar Sep 29 '25 02:09 nonlin

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

morganavr avatar Sep 29 '25 10:09 morganavr

Yeah, this issue still persists and it is so annoying

Nenormalniy avatar Oct 15 '25 12:10 Nenormalniy

+1 still having this issue.

devsmm avatar Oct 20 '25 12:10 devsmm

Closing in favor of #4003, which has more upvotes

etraut-openai avatar Nov 12 '25 03:11 etraut-openai