July 27, 2004

Newbie Linux/Mac OS X tip: I finally found a page that explains the Linux backspace/delete terminfo stuff well enough that I was able to fix backspace behavior on my Linux box when I used Mac OS X Terminal. Terminal uses "xterm-color" as its TERM, which, in my Debian 3.0r2 installation, had the undesired (but common) values for kbs (backspace) and kdch1 (delete). I was able to fix it with:

  1. Log in to the affected Linux box.
  2. echo $TERM to confirm the terminfo setting. (Mac OS X Terminal should be using xterm-color.)
  3. infocmp >xterm-color
  4. Edit xterm-color, find kbs and make sure it reads kbs=\177, and find kdch1 and make sure it reads kdch1=\E[3~. Save.
  5. mkdir -p ~/.terminfo/x
  6. Temporarily set the TERMINFO environment variable to ~/.terminfo. In bash/zsh: export TERMINFO=~/.terminfo
  7. Test-compile the new terminfo file: tic xterm-color If successful, ~/.terminfo/x/xterm-color will be the compiled terminfo file.
  8. unset TERMINFO
  9. If desired, back up the original compiled terminfo file. Look for it as /etc/terminfo/x/xterm-color or /usr/lib/terminfo/x/xterm-color.
  10. Run tic xterm-color again as root (using su or sudo) to compile and install the new version in the official location.

comments...

I've got kdch1=\004. I'm preferring the behaviour overall.

Notably I've got the same thing set in Terminal.app's 'keyboard' preferences.

Hope this helps somebody.

Awesome, I was dreading having to figure this out myself.