Cursor adds final newline to files on quit despite files.insertFinalNewline: false

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When quitting Cursor, a trailing newline is automatically added to files that don’t have one, even with files.insertFinalNewline set to false in workspace settings. This causes git status to show these files as modified every time I reopen the editor.

Steps to Reproduce

Steps to Reproduce:
Create or have a file that doesn’t end with a newline character
Commit it to git
Add “files.insertFinalNewline”: false to .vscode/settings.json or .cursor/settings.json
Open the project in Cursor
Quit Cursor (Cmd+Q / Alt+F4)
Reopen Cursor and run git status
The file now shows as modified with a newline added at the end

Expected Behavior

Expected Behavior:
Files without a trailing newline should remain unchanged when quitting Cursor, respecting the files.insertFinalNewline: false setting.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2.2.20 (Universal)
VSCode Version: 1.105.1

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

A post was merged into an existing topic: Cursor modifying files on startup