Apparently pressing C-[ (three times in a row it seems?) (or alternatively ESC three times) closes a frame. I oftentimes accidentally press C-[ when I meant to press C-p. I tried to disable it with

(define-key "\C-[" KEY nil) which does nothing

as well as

(dolist (key '("\C-["))
 (global-unset-key key))

which for some reason makes my meta key not work anymore.

How can I disable \C-[?


C-[ is bound to ESC with this knowledge:

Your question has already been answered here and here

For how to remap ESC have a look here.
For remapping ESC see last link the correct order is:

(define-key key-translation-map (kbd "C-<escape>") (kbd "ESC"))
(define-key key-translation-map (kbd "ESC") (kbd "C-g"))
  • Instead of repeating an answer to a duplicate question, please vote to close the question as a duplicate. – Drew Jul 20 '17 at 4:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.