0

When I run a client in a terminal with emacsclient -nw, for some reason Backspace triggers C-h. This doesn't happen with emacs -nw or with the client running in a window. In both cases, as expected, Backspace deletes the previous character. What can be the cause of this behavior and how can I fix that?

vonaka
  • 171
  • 7
  • This may not be helpful, but I assume your terminal is interpreting backspace as C-h, as C-h is essentially delete character backwards in the terminal. This may not be an Emacs issue. – Arktik Mar 04 '23 at 15:29
  • 2
    Does this answer your question? [How to remap backward-delete and help command while using Emacs from a terminal emulator?](https://emacs.stackexchange.com/questions/35524/how-to-remap-backward-delete-and-help-command-while-using-emacs-from-a-terminal) – Drew Mar 04 '23 at 16:18

1 Answers1

1

From the manual:

   On a text terminal, if you find that <BACKSPACE> prompts for a Help
command, like ‘Control-h’, instead of deleting a character, it means
that key is actually sending the ‘BS’ character.  Emacs ought to be
treating <BS> as <DEL>, but it isn’t.

   In all of those cases, the immediate remedy is the same: use the
command ‘M-x normal-erase-is-backspace-mode’.  This toggles between the
two modes that Emacs supports for handling <DEL>, so if Emacs starts in
the wrong mode, this should switch to the right mode.  On a text
terminal, if you want to ask for help when <BS> is treated as <DEL>, use
<F1> instead of ‘C-h’; ‘C-?’ may also work, if it sends character code
127.
NickD
  • 27,023
  • 3
  • 23
  • 42