gitvisual-studio-codenewlinecarriage-returnline-endings

How to disable ^M line endings in VS Code?


VS Code has decided to start adding ^M characters to the end of any line I edit.
They're not visible in the editor but git diff picks them up.

Weird line endings.

It wasn't doing this before, so I'm guessing I accidentally bumped some keyboard shortcut.

Does anyone know how to turn this off and have it just use regular line endings?


Solution

  • That's caused by the different standards used in line endings (LineFeed or LF in Linux and CarriageReturn + LineFeed or CRLF in Windows).

    You can set the encoding you want by either of the following ways: