I'm totally dumbfounded. I have two users on the same machine running macOS. Both of them have the same .emacs, same iTerm profile. However the "delete" key works correctly as backspace for on one of them, but doesn't on the other. I know I can use M-x normal-erase-is-backspace-mode to work around the issue, but it's very annoying. I don't really care whether it behaves one way or the other, as long as it's consistent. Any good suggestions on what might cause the discrepancy?

P.S. this only happens when I run emacs with -nw. In the normal X window mode the delete/backspace works for both users

  • 1
    Can you find no differences? Same keyboard? What about the default behavior (emacs -Q) - is it the same for both?
    – Drew
    Apr 18, 2017 at 1:34
  • Added more info. This only happens when running without X window. With emacs -Q -nw the behavior is still inconsistent between the two users.
    – Chris
    Apr 20, 2017 at 17:32
  • Sounds like they're using different terminal emulators, correct?
    – Dan
    Apr 20, 2017 at 18:33
  • Are they both running the same Emacs? (a frequent issue on macOS seems to be that on the terminal $PATH is not setup the same as GUI, causing some ancient version of Emacs (like 22 or something?) to be used)
    – npostavs
    Apr 20, 2017 at 18:33
  • 2
    Could it be a shell setting in .profile or .bashrc? Look for something like 'stty erase'.
    – Alan Third
    Apr 20, 2017 at 21:12

1 Answer 1


Since this only affects Emacs running in the terminal, it's probably a terminal setting of some description. You've already looked at the iterm2 and terminal settings, but you should check the users' shell startup scripts (.profile, .bashrc, .zshrc, etc.).

The usual method of remapping the delete key is to use something like:

stty erase <backspace character>

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.