commentLine key shortcut "command not found"

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When i press my keybinding for commentLine (cmd + ’ ), a warning pops up saying command not found.

I have deleted any conflicting binds, and re-bound it the those keys - both via the shortcuts ui

SCR-20260316-mmtg

Steps to Reproduce

Press the keyboard shortcut

Expected Behavior

Should comment out a line

Operating System

MacOS

Version Information

Version: 2.6.19
VSCode Version: 1.105.1
Commit: 224838f96445be37e3db643a163a817c15b36060
Date: 2026-03-12T04:07:27.435Z
Build Type: Stable
Release Track: Default
Electron: 39.4.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Darwin arm64 25.2.0

Additional Information

Was working a few days ago, seems like the last update (?) broke it.

I have also not installed any new extensions etc

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, I can see a screenshot of your keybinding setup.

The command not found error usually means the command ID in keybindings.json is wrong. Can you check a couple things?

  • Open the Command Palette Cmd+Shift+P, search for Toggle Line Comment, and run it. If it works, the issue is with the keybinding, not the command itself.
  • Open keybindings.json with Cmd+Shift+P, then run Preferences: Open Keyboard Shortcuts JSON, and paste your entry for commentLine here. We need to make sure the command ID is set to editor.action.commentLine, and not something else.

A correct entry should look like this:

{
  "key": "cmd+'",
  "command": "editor.action.commentLine"
}

Let me know what you find.

Seems the command doesn’t work from the Command Palette

json is correct:


  {
    "key": "cmd+'",
    "command": "editor.action.commentLine"
  },
1 Like

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