I accidentally hit the insert key so often that I put some code in my .emacs to disable the overwrite-mode key binding:

(define-key global-map [(insert)] nil)
(define-key global-map [(control insert)] 'overwrite-mode)

This works fine when using emacs within X. However, when I run emacs in the terminal (with -nw or over ssh), insert still turns on overwrite mode.

How can I bind insert in a terminal?

1 Answer 1


Turns out that I needed to redefine the key binding for insertchar as opposed to just insert. This means adding

(define-key global-map [(insertchar)] nil)

to .emacs.

  • 1
    Note also that C-h k <insert> in a terminal would give you the key description <insertchar> and therefore you could use (kbd "<insertchar>") in your define-key call. C-h k always gives you a key sequence string that you can plug into kbd.
    – phils
    Mar 18, 2018 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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