Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of jjore (6662)

Thursday April 05, 2007
06:07 PM

M***-F***ing emacs + screen

[ #32921 ]

I just noticed that I couldn't use emacs from within screen at work. Whenever I pressed control-H to open a help screen, emacs would delete a character. This is not the normal operation. It turns out that both my terminfo and /etc/screenrc were "broken" by someone else who thought they were being useful. Idiots.

Here's how I fixed stuff so delete means \e[3~, backspace means ^? and ^H means ^H. The output of "tput kbs | od" was 010 (^H in octal), not 177 (^? in octal). To correct this, I altered my terminfo database.

Translate the local termcap info into terminfo source with captoinfo (or alegedly, "tic -I").

captoinfo -e screen > ~/.terminfo/s/screen.ti

Edit the file so the kbs entry refers to ^? instead of ^H. Compile it with tic and you should have a new ~/.terminfo/s/screen. Terminfo applications seem to just use the file automatically so there's no additional configuration needed.

tic ~/.terminfo/s/screen.ti

I had to also unbreak my /etc/screenrc. I don't know why it was set this way but someone put a comment in there next to the broken setting when they changed it that implied that they thought ^H was the "proper" setting.

This line is an empty definition for the kb termcap entry and it unsets the badness.

# ~/.screenrc
bindkey -d -k kb

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Ctrl-H is also the ASCII code of backspace (chr(8)). I don't know if pressing ctrl-H does the same as pressing backspace on your system, but I'm sure that's the reason.
    • Yes, I'm aware there's some history where ^H means backspace but that doesn't seem to be appropriate on any system I'm using these days. I'm not sure that any typical emacs using OS should be redefining ^H away.

      I don't really know the history on this. I'm sure it all goes back to some glass terminals and who was more popular in a particular year.