Cursor should know how to disable ctrl-k (for terminal)
I use ctrl-k on the command line to delete all characters starting from the current position.
This is hard-wired into my brain, since I use it for 20 years.
I asked Cursor how to update the config, so that ctrl-k in the terminal does not open the smart pop-up.
It failed badly. And I found no solution, too.
I had this issue too. You can goto Keybindings and search for ctrl + k and remove the startComposer binding there.
Same issue to me. I tried to remove all conditions that conflict with 'command+k', but the clear command still doesn't work in the terminal.
So far, I have to type cl to clear my terminal after done this alias cl=clear
that keybniding is still there i think? you can right click on it and select "Remove keybinding" option.
that keybniding is still there i think? you can right click on it and select "Remove keybinding" option.
Yes, remove is ok with it, but I don't know why setting 'when' to empty is not work.
when only limits the scope of when this binding should work. without it, it is applicable everywhere reference
Same issue to me. I tried to remove all conditions that conflict with 'command+k', but the
clearcommand still doesn't work in the terminal.
Delete "Generate in Terminal" . Then it starts working.
This is an absurly annoying bug - what would drive you to pick basically the most used terminal shortcut and override it with an AI feature??
I finally took the time today to go to settings, search for "clear terminal", click on "same shortcut"
You could also search shortcuts with the phrase "Command+K"
Then delete Generate in Terminal.
then it started working.
I literally don't use any other shortcuts in terminal. CMD-K is very important so we can delete all the old output in one go, and have a new clean terminal and then run whatever we're running again, only seeing the latest outputs.
Please change this to pretty much anythiung else. Just not CMD=K in terminal. Thanks.
Ran into the same issue except ctrl + shift + k. (line delete)
Find cursorai.action.generateInTerminal in the keyboard shortcuts and remove it.
Or, add a new key binding for it, I used cmd + k cmd + k (hold down cmd and press k twice).
This way you can still get the AI feature quickly, but it doesn't mess with my muscle memory for cmd + k to clear.
Thanks that’s what I did. Just took me a while to find the right shortcut to disable. On 23 Nov 2024, at 01:02, Stephen Last @.***> wrote: Find cursorai.action.generateInTerminal in the keyboard shortcuts and remove it. Or, add a new key binding for it, I used cmd + k cmd + k (hold down cmd and press k twice). This way you can still get the AI feature quickly, but it doesn't mess with my muscle memory for cmd + k to clear.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>
I'm in the same boat but when I delete or remap or change the when condition for the ctrl+k command it inserts it into the bottom of my keybindings.json file. If I delete that and save the file. It undoes the global changes I made in the default settings. What the fuck!!!???
Yep, quite annoying this mapping. I ended using @stephen-last suggestion.
Open your user-level keybindings.json
Add this to the very bottom
Code
- NOTE: the
-at the head of thecursorai.action.generateInTerminalcommand negates the binding
{
"key": "cmd+k",
"command": "-cursorai.action.generateInTerminal",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
}
Credit: https://github.com/getcursor/cursor/issues/1756#issuecomment-2494288147
Thanks @stephen-last for finding the setting, my sanity was waning
UPDATE:
And only two weeks later they changed it again ...
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"
😭
Hey, can the Cursor devs maybe pick a new keybinding and quit overriding Command+K in general? It's a very commonly used keybinding for devs using the integrated terminal, and it broke again when I updated Cursor after I specifically defined a custom keybinding to override it.
It seems user-hostile to change my keybindings without asking me, and even more so for a shortcut that's so regularly used.
Hey, can the Cursor devs maybe pick a new keybinding and quit overriding
Command+Kin general? It's a very commonly used keybinding for devs using the integrated terminal, and it broke again when I updated Cursor after I specifically defined a custom keybinding to override it.It seems user-hostile to change my keybindings without asking me, and even more so for a shortcut that's so regularly used.
I second this! Exactly the same thing happened to me again a few days ago...
Open your user-level keybindings.json
##### Add this to the very bottom
##### Code * NOTE: the `-` at the head of the `cursorai.action.generateInTerminal` command negates the binding
{ "key": "cmd+k", "command": "-cursorai.action.generateInTerminal", "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported" } Credit: #1756 (comment)
Thanks @stephen-last for finding the setting, my sanity was waning
UPDATE:
And only two weeks later they changed it again ...
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"😭
Thank you!
My final working configuration (read https://github.com/getcursor/cursor/issues/1756#issuecomment-2781003573 for details):
{
// https://github.com/getcursor/cursor/issues/1756
"key": "cmd+k",
"command": "-cursorai.action.generateInTerminal",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"
},
{
// https://github.com/getcursor/cursor/issues/1756
"key": "cmd+i",
"command": "cursorai.action.generateInTerminal",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"
},
- Invalidate ⌘ command + k in terminal.
- Add ⌘ command + i to use the
cursorai.action.generateInTerminalcommand.
Just passing to give my opinion as well: this cdm + k in terminal is the worst default ever!
You shouldn't use as a default a keyboard shortcut that people are already used to do something else, for decades!
Just passing to give my opinion as well: this cdm + k in terminal is the worst default ever!
Agreed. First thing I changed.
Same thing goes for Ctrl + L. Very annoying that that it automatically jumps to the chat.
A possible solution to allow multiple uses of the hotkeys for both terminal and other Cursor functionality would be to perform actions based on the active window, e.g:
- If terminal window is active: use hotkeys for terminal actions
- If the code window is active: use hotkeys for Cursor chat etc.
Edit 1: Will try some of the workarounds mentioned above. Edit 2: Similar to @brianwarsing I achieved what I wanted with:
// Custom addition to unbind and rebind the above definition(s) if we are in terminal window.
// This allows regular functionality if you are anywhere else than in an active terminal window.
{
"key": "ctrl+l",
"command": "workbench.action.terminal.clear",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported || terminalHasBeenCreated && terminalPromptBarVisible || terminalProcessSupported && terminalPromptBarVisible"
}
##### Add this to the very bottom
##### Code
* NOTE: the `-` at the head of the `cursorai.action.generateInTerminal` command negates the binding