0

Steve recommends to run the following code before you start your Emacs

stty erase ^\?

I get after running it

stty: illegal option -- Backups
usage: stty [-a|-e|-g] [-f file] [options]

Steve's blog post

Note that the ^\? - - dorks the Delete key by making it send a ^H, but enables the C-h sequence in Emacs. Note that C-Delete does a normal backward-delete-char, so just remember that when you're backspacing in a terminal, hold the control key down.

How can you see what Steve's command does?

Pierre.Vriens
  • 1,159
  • 34
  • 15
  • 19

2 Answers2

1

That command works fine for me. At first I thought perhaps you weren't using bash, and the ^ or \ characters were being interpreted differently, so I tried csh and sh and it still worked fine. Are you sure that you're typing "^" (shift 6) "\" (not /) and "?" (normal question mark)?

You can try it like this:

stty erase "^?"

which should have the same effect.

If that doesn't work, I can't help since I don't have access to OS X. Good luck!

Randy Orrison
  • 490
  • 6
  • 11
  • I use Zsh. Your command seems to work with quotes. However, I am still unsure where to see the difference: Should I see the difference in Emacs or outside of Emacs? -- I run the command, type "nonsense" and pressed a backspace => a letter was removed. – Léo Léopold Hertz 준영 Jun 06 '09 at 22:47
  • 1
    See my other answer for outside emacs. Within emacs, if I remember correctly, the default binding for ^h was help, and the DEL key was bound to backup-and-delete. This stty command makes DEL do backup-and-delete, so it's consistent. The defaults may have changed, or your settings may be different. I know that the backspace key has worked "right" for me both within and outside emacs for a few years, without me having to do anything special. What problem are you having, and what are you trying to achieve? – Randy Orrison Jun 06 '09 at 23:39
  • @Randy: Thank you! I now know what the command does - it solved a problem for me at my server. – Léo Léopold Hertz 준영 Jun 07 '09 at 13:34
1

How can you see what Steve's command does?

If the command is successful, there will be no output. However, it's easy to see what it has done: at the prompt type something then try to backspace over it. Instead of erasing what you typed, you'll get ^H displayed for every backspace you type.

To return things to normal, use this command:

stty erase ^h

(that's just shift 6, then h)

As with my first answer, this works for me on Ubuntu with bash. However, it may be different on OS X.

Randy Orrison
  • 490
  • 6
  • 11