Ctrl+n in chat panel

On a Mac, Ctrl+n navigates down one line in most text editing contexts I know of. This is true everywhere I look - VSCode, Chrome, Slack, Emacs, Google Docs and Vim (just a few examples - the list goes on).

AFAICT this is an old Emacs thing that has become a longstanding convention across many types of software.

In the Cursor chat panel, Ctrl+n creates a new chat altogether, often losing my draft prompt.

This is a major point of friction for me in using Cursor! Ctrl+n for ‘down one line’ is a deeply ingrained habit from decades of use; Cursor is the only app that punishes me for using it.

I notice that there’s no obvious way to override this in settings (see image).

Is there any chance this could be removed from the default bindings? Cmd+n already creates a new chat, much like you’d expect on a Mac, so I’d argue Ctrl+n is redundant for this purpose anyway.

7 Likes

Same problem in Composer panel Ctrl+n in composer panel - #4 by reorx

4 Likes

I found a solution to this @rob137 @reorx

Open command palette and search “Open Keyboard Shortcuts (JSON)” and open the JSON file.

Then, add this:

  {
    "key": "ctrl+n",
    "command": "-composer.createNew",
    "when": "composerFocused || focusedView =~ /^workbench.panel.aichat.view/"
  }

this should fix it. Incidentally, it also fixed Ctrl + D (to froward delete) for me.

2 Likes

Many thanks @prasoon

Just tried adding that, saving, and reopening Cursor - but no such luck. I’m on a Mac. No issues with ctrl+d FWIW.

Though seeing this response makes me optimistic that there is a way…

Interesting. I’m also on Mac so I’m not sure what’s going on.

Here’s what I actually did step by step:

  • open keyboard shortcuts (UI), find the cursor command that opens up a new window (Cmd +N)
  • Delete this keybinding in the UI
    • This will add a JSON block like the one above one in your Keyboard Shortcuts (JSON) but for Cmd + N

Now, whatever JSON block that was added to the JSON file, just copy the exact same thing over and change it from key: "cmd+n" to key: "ctrl+n" and it should work.

EDIT:

So, for example, here’s the final state of my keyboard shortcuts json that relate to cursor opening a new chat:

  {
    "key": "cmd+n",
    "command": "-composer.createNew",
    "when": "composerFocused || focusedView =~ /^workbench.panel.aichat.view/"
  },
  {
    "key": "ctrl+n",
    "command": "-composer.createNew",
    "when": "composerFocused || focusedView =~ /^workbench.panel.aichat.view/"
  }

Perhaps you need BOTH the keyboard shortcuts disabled for it to work!

1 Like

Oh actually @rob137 looks like you need to be on 0.47 version of cursor for this keybinding update to take effect. See this thread here:

Many thanks - yes, update to 0.47.8 and adding the following to my keybindings.json solve this for me:

{
    "key": "cmd+n",
    "command": "-composer.createNew",
    "when": "composerFocused || focusedView =~ /^workbench.panel.aichat.view/"
}
2 Likes