Skip to content

Instantly share code, notes, and snippets.

@dfrankland
Created July 8, 2025 00:50
Show Gist options
  • Save dfrankland/7650a6e36a910a51196fed0c03ec52cb to your computer and use it in GitHub Desktop.
Save dfrankland/7650a6e36a910a51196fed0c03ec52cb to your computer and use it in GitHub Desktop.
Fix Cmd+K keyboard shortcut in Cursor (credit: https://forum.cursor.com/t/command-k-and-the-terminal/7265/21)
  1. Press Command + Shift + P (to open Command Palette)
  2. Search: “Keyboard Shortcuts (JSON)”
  3. Upload the following JSON content in the keybindings.json file
// Place your key bindings in this file to override the defaults
[
  {
    "key": "shift+cmd+k",
    "command": "cursorai.action.generateInTerminal",
    "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
  },
  {
    "key": "cmd+k",
    "command": "-cursorai.action.generateInTerminal",
    "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"
  },
  {
    "key": "cmd+k",
    "command": "composer.startComposerPrompt",
    "when": "composerIsEnabled && !terminalFocus"
  },
  {
    "key": "cmd+k",
    "command": "-composer.startComposerPrompt",
    "when": "composerIsEnabled"
  }
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment