I use Iterm2 on the Mac. Many times, I accidentally press Command+some key, so I'm wondering, is it possible to disable the Command shortcuts? Like Command+D for example, as I use tmux for split panes.
4 Answers
You'll want to override iTerm's default shortcuts with your own shortcuts to "Ignore".
Go to Preferences > Key
and press the + button at the bottom of the Global Shortcut Keys:
Then add an entry for Cmd+K and choose "Ignore" for the action:
This disables Cmd+K.
-
3In my case I need to bubble the shortcut action up to the OS. Ignore seems actually stop it. Any solution for this? thanks– masciugoMar 11, 2020 at 7:54
Another useful option - you want to use Ctrl-C, Ctrl-V and Ctrl-Z in iTerm2, but you defined them globally on your Mac as Copy, Paste, Undo shortcuts.
To be able to use those shortcuts in iTerm2 to stop running command (ctrl-c), insert special character (ctrl-v) or put program into background (ctrl-z):
- create shortcuts ctrl-c ctrl-v ctrl-z in iTerm2 - Preferences > Keys > + same as in above solution
- instead of Ignore chose action "Do Not Remap Modifiers"
And now you can use ctrl-c for copy in rest of mac os and for break inside iTerm2.
You could just go to Preferences > Keys and manually delete every shortcut with Cmd.
-
2
-
1
-
@Behrang we don't delete wrong answers for that reason alone. Can you explain he harm here or better, why exactly this is wrong.– bmike ♦Mar 10, 2014 at 12:35
-
2The
Preferences > Keys
panel does not contain an entry for Cmd+K so there's nothing to delete that can fix this issue.– BehrangMar 10, 2014 at 14:43 -
Yes, the harm here is the possibility of a user wasting time trying to use this answer when, in fact, it cannot possibly work.– Br.BillAug 29, 2019 at 17:02
ignore
shortcut below also works to disable this