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.
You'll want to override iTerm's default shortcuts with your own shortcuts to "Ignore".
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.
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.