Shortcut Conflict for (cmd+K ) Terminal Clear and AI Window

There is a shortcut conflict in the Cursor IDE that prevents the terminal from being cleared using Cmd+K. Instead of clearing the terminal, it opens the AI assistance chat window. This issue disrupts workflow, especially for users accustomed to clearing the terminal frequently.

Environment:

  • IDE: Cursor IDE
  • Operating System: macOS
  • Python environment: pyenv with multiple virtual environments (see attached screenshot for details)

The conflict may stem from the IDE’s predefined shortcut mapping that overrides terminal functions.

Thank you for looking into this issue!

3 Likes

Ctrl-L works in any terminal.

Or redefine your shortcut.

1 Like

Wow thats super helpful :exploding_head:

Just know, Ctrl+L is not default in macOS

1 Like

It is for clearing terminal, in any “Unix” as far as I know.

Cursor chat is Cmd-L, of course.

Just a note that CTRL+L clears the visible pane but not the whole scroll-back history as is the case with CMD+K. In a way it’s better if you don’t want to lose your previous commands/output in the terminal.

2 Likes

cursor has both cmd+L and cmd+K bindings for its key chat functionality, which clashes with the terminal clear commands

2 Likes

Terminal is Ctrl-L on a mac (too).

For folks looking to just have Ctrl+l work in their terminal as usual (clear terminal without losing scrollback buffer) while retaining the Ctrl+l functionality for opening up a chat window while coding on a file, you can add the following to your Keyboard Shortcuts (JSON) settings:

{
        "key": "ctrl+l",
        "command": "aichat.newchataction",
        "when": "!terminalFocus"
    },
    {
        "key": "ctrl+l",
        "command": "-aichat.newchataction"
    }

(tested on windows and ubuntu, unsure of whether it’ll work on Mac)

1 Like

I believe the point of this thread is the following:

In the context menu cursor clearly states that cmd+k is clear. It is not, it is conflicting with other hotkeys.

THis needs to be corrected. Cursor should not hint a hotkey that has bind conflictions and does not work.

Notes

  1. cmd+l is not the same as cmd-k
  2. these are very old hotkeys, they go back 1-2 decades. Cursor should consider this when picking application specific hotkeys.
4 Likes

Agreed. ctrl+L clears the terminal but doesn’t clear the scrollback buffer. cmd+k is the default keybind to also clear scrollback buffer. Having cmd+k firing up the Terminal: generate in terminal is a very bad UX choice and should be set as a different keybind.

As a workaround, from the Keyboard shortcuts settings, look for Terminal: generate in terminal and bind it to something else (I used cmd+g cmd+t chord, as in (g)enerate in (t)erminal).