The conventional way to convert terminfo to termcap is with
infocmp -Cr
The infocmp option -C
tells infocmp
to use termcap names, and the -r
option tells it to translate terminfo capabilities to termcap format. Some (such as the expressions used in sgr
) will not translate, and infocmp
may leave commented-out capabilities if there is enough space.
By "enough space", refers to the fact that real termcap applications allow only 1023 bytes in a description. FreeBSD uses ncurses underneath, but some applications make assumptions about the entry length.
FreeBSD however does have a termcap file which is independent of ncurses. There also is a "port" for ncurses, which some find useful.
By the way, you may be referring to this: termite/termite.terminfo. If you translated it, you might see something like
# vim: noet:ts=8:sw=8:sts=0
# (untranslatable capabilities removed to fit entry within 1023 bytes)
# (sgr removed to fit entry within 1023 bytes)
# (acsc removed to fit entry within 1023 bytes)
# (terminfo-only capabilities suppressed to fit entry within 1023 bytes)
xterm-termite|VTE-based terminal:\
:am:hs:km:mi:ms:xn:\
:co#80:it#8:li#24:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:K2=\EOE:LE=\E[%dD:RI=\E[%dC:SF=\E[%dS:SR=\E[%dT:\
:UP=\E[%dA:ae=\E(B:al=\E[L:as=\E(0:bl=^G:bt=\E[Z:cd=\E[J:\
:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:cr=^M:\
:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:do=^J:\
:ds=\E]2;\007:ec=\E[%dX:ei=\E[4l:fs=^G:ho=\E[H:im=\E[4h:\
:is=\E[!p\E[?3;4l\E[4l\E>:k1=\EOP:k2=\EOQ:k3=\EOR:\
:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:\
:k9=\E[20~:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kb=\177:\
:kd=\EOB:ke=\E[?1l\E>:kh=\EOH:kl=\EOD:kr=\EOC:\
:ks=\E[?1h\E=:ku=\EOA:le=^H:md=\E[1m:me=\E[0m:mh=\E[2m:\
:mm=\E[?1034h:mo=\E[?1034l:mr=\E[7m:nd=\E[C:rc=\E8:sc=\E7:\
:se=\E[27m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:te=\E[?1049l:\
:ti=\E[?1049h:ts=\E]2;:ue=\E[24m:up=\E[A:us=\E[4m:\
:vb=\E[?5h\E[?5l:ve=\E[?12l\E[?25h:vi=\E[?25l:\
:vs=\E[?12;25h:
There are a few errors in the terminfo entry (VTE does not support meta mode, for instance). Also, in termcap format you may notice that most of the function-keys go away (1023-byte limit).
Further reading:
infocmp -C
to produce a termcap entry.infocmp -C xterm-termite >> /usr/share/misc/termcap; cap_mkdb /usr/share/misc/termcap
. Feel free to add it as an answer, so I can approve it.