Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a terminfo entry (eterm-color from Emacs)?

I want to run GNU Screen from within an Emacs term-mode buffer. When I try to do this I get an error:

$ screen
Cannot find terminfo entry for 'eterm-color'.

This error suggests that I should install the eterm-color terminfo entry. I attempted to do this in 2 ways which both failed.

The first attempt was to use the TERMINFO environment variable.

My .bashrc:

export TERMINFO=~/.terminfo

Then I did:

$ mkdir -p ~/.terminfo/e/
$ cp /usr/local/Cellar/emacs/23.3a/share/emacs/23.3/etc/e/* ~/.terminfo/e/

In the term-mode buffer the eterm-color entry is not found. It says that it gets eterm-color from TERMCAP instead of from the actual file.

$ infocmp
#       Reconstructed via infocmp from file: TERMCAP
eterm-color,
        am, mir, xenl,
        colors#8, cols#138, it#8, lines#41, pairs#64,
        bel=^G, bold=\E[1m, clear=\E[H\E[J, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J,
        el=\E[K, el1=\E[1K, home=\E[H, ht=^I, ich=\E[%p1%d@,
        il=\E[%p1%dL, il1=\E[L, ind=^J, invis=\E[8m, kbs=\177,
        kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
        kdch1=\E[3~, kend=\E[4~, khome=\E[1~, knp=\E[6~, kpp=\E[5~,
        nel=^M^J, op=\E[39;49m, rc=\E8, rev=\E[7m, rmir=\E[4l,
        rmso=\E[27m, rmul=\E24m, rs1=\Ec, sc=\E7, setab=\E[4%p1%dm,
        setaf=\E[3%p1%dm, sgr0=\E[m, smir=\E[4h, smso=\E[7m,
        smul=\E[4m,

The second attempt was to use symlinks.

$ sudo mkdir /usr/share/terminfo/e/
$ sudo cp /usr/local/Cellar/emacs/23.3a/share/emacs/23.3/etc/e/* /usr/share/terminfo/e/

This failed in the same way as the first attempt.

Why did neither attempt work? How do I get the eterm-color terminfo entry installed?

I am running OS X 10.6.8 and Emacs 23.3.1.

like image 430
hekevintran Avatar asked Dec 29 '11 09:12

hekevintran


1 Answers

The following worked for me on FreeBSD.

Put the termcap entry pasted below in /usr/share/misc/termcap and run # cd /usr/share/misc/ && cap_mkdb termcap.

    # Termcap entry for eterm-color (taken from $TERMCAP set by emacs and formatted)
    eterm-color|Emacs term.el terminal emulator term-protocol-version 0.96:\
           :am:bs:mi:pt:xn:\
           :Co#8:co#166:li#48:pa#64:\
           :@7=\E[4~:AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:\
           :DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:LE=\E[%dD:RI=\E[%dC:\
           :UP=\E[%dA:al=\E[L:bl=^G:cb=\E[1K:cd=\E[J:ce=\E[K:\
           :cl=\E[H\E[J:cm=\E[%i%d;%dH:cr=^M:cs=\E[%i%d;%dr:dc=\E[P:\
           :dl=\E[M:do=^J:ei=\E[4l:ho=\E[H:im=\E[4h:kD=^[[3~:\
           :kN=\E[6~:kP=\E[5~:kb=^?:kd=\EOB:kh=\E[1~:kl=\EOD:\
           :kr=\EOC:ku=\EOA:le=^H:md=\E[1m:me=\E[m:mk=\E[8m:mr=\E[7m:\
           :nd=\E[C:op=\E[39;49m:r1=\Ec:rc=\E8:sc=\E7:se=\E[27m:sf=^J:\
           :so=\E[7m:ta=^I:ue=\E[m:\
           :up=\E[A:us=\E[4m:
like image 182
jrm Avatar answered Nov 03 '22 22:11

jrm