Cursor deleting newly created file when cmd-n is pressed

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I try to create a new file with CMD-N on the Mac. Instead of creating a new tab for a new file, Cursor completely deletes the current file instead.

NOTE: This is a copy/paste from a closed bug report (besides the version info is my own) as I am having the same experience as the OP of that bug report: Cursor deleting file when cmd-n is pressed

Steps to Reproduce

Have a lot of unreviewed LLM output in a file that the LLM created. Have this be the active tab. Press cmd-n on the Mac. The file gets deleted and the tab disappears.

Expected Behavior

Create an empty new tab instead of deleting the existing file

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.7.40
VSCode Version: 1.99.3
Commit: df79b2380cd32922cad03529b0dc0c946c311850
Date: 2025-10-09T02:55:11.735Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 25.0.0

Additional Information

This is very bad. Fortunately the LLM has a good memory and can recreate the entire file from scratch, but this heavily shakes my confidence in the editor.

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for reporting this! This is actually working as intended, though I can see how it’s confusing.

When you’re in review mode (after LLM generates code), CMD-N is temporarily bound to “Undo” (reject changes), and CMD-Y is “Accept” - you can see this in the review UI buttons.

The workflow should be:

  1. Review the LLM output

  2. Press CMD-Y to accept (or CMD-N to reject)

  3. Exit review mode

  4. Then CMD-N works normally for creating new files

The file gets deleted because you’re pressing CMD-N while still in review mode, which rejects/undoes the LLM’s changes. Since the file was newly created by the LLM, rejecting it deletes the whole file.

Tip: Always complete your review (accept or reject) before trying to create a new file. Hope this helps clarify the behavior!

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