Solved terminfo: where are the sources?

Colleagues, can you please tell me where the terminfo database sources are?

I have one thing written in terminfo, but something else happens in life.

My terminal is "xterm". tigetstr() for "kcub1" ("cursor left") gets "\EOD".
The program, when pressing the "cursor left" key, reads from stdin "\E[D".
I want to see what field this sequence corresponds to.

Thanks in advance for your reply,
Ogogon.
 
terminfo(5) is termcap(5) on FreeBSD:

terminfo(5)
Code:
NAME
       terminfo    - terminal capability data base
....
DESCRIPTION
       Terminfo     is  a data base describing terminals,...
....
FILES
       /usr/share/misc/terminfo/?/*
                                 files containing terminal descriptions
...

termcap(5)
Code:
NAME
     termcap --    terminal capability data base
...
DESCRIPTION
     The termcap file is a data    base describing    terminals, .... 
....
FILES
     /usr/share/misc/termcap     File containing terminal descriptions.
....
 
terminfo(5) is termcap(5) on FreeBSD:

terminfo(5)
Code:
NAME
       terminfo    - terminal capability data base
....
DESCRIPTION
       Terminfo     is  a data base describing terminals,...
....
FILES
       /usr/share/misc/terminfo/?/*
                                 files containing terminal descriptions
...

termcap(5)
Code:
NAME
     termcap --    terminal capability data base
...
DESCRIPTION
     The termcap file is a data    base describing    terminals, ....
....
FILES
     /usr/share/misc/termcap     File containing terminal descriptions.
....
Forgive me, please, but I did not understand the meaning of your answer.
 
No problem. :) What important is, the misunderstanding has been cleared up.
Oh, did you finally understand that I was not asking about termcap, but about terminfo? Better late than never!
I believe that this misunderstanding has been removed.

It's just a pity that I didn't get a clear answer to my question...
 
I don't know anything about this, but you (ogogon) asked about terminfo.

T-Daemon's said that this is handled by termcap on FreeBSD - and the man pages look very similar (to someone who doesn't know anything about it!), except that the termcap says to look in /usr/share/misc/termcap and that file does exist.

You are not finding anything in the location pointed out by the terminfo man page because that's not used by FreeBSD. Anything you are reading about terminfo - look at termcap instead (at least that's what I'm taking T-Daemon's answer to mean, and it makes sense looking at the two man pages.)

HTH
 
I believe that this misunderstanding has been removed.
I believe it continues.

It's just a pity that I didn't get a clear answer to my question...

My apologies, but I was under the impression you are going to use the source files describing terminals to see what field corresponds to the "\E[D" sequence for your x11/xterm terminal, all for FreeBSD usage.

Pointing to something else than termcap(5) wouldn't make any sense. FreeBSD doesn't use the terminfo(5) source files or data base to describe terminals:
Code:
ls -l /etc/termcap*
lrwxr-xr-x  1 root  wheel     23 Oct 23 08:39 /etc/termcap -> /usr/share/misc/termcap
-rw-r--r--  1 root  wheel  12297 Oct 23 08:39 /etc/termcap.small

ls -l /usr/share/misc/termcap*
-r--r--r--  1 root  wheel   212406 Oct 23 08:36 /usr/share/misc/termcap
-r--r--r--  1 root  wheel  1343488 Oct 23 08:36 /usr/share/misc/termcap.db

From /usr/share/misc/termcap respectively /etc/termcap.small:
Code:
# This is the only entry which you should have to customize, since "xterm"
# is widely used for a variety of incompatible terminal emulations including
# color_xterm and rxvt.
xterm|X11 terminal emulator:\
    :tc=xterm-new:
....
xterm-new|modern xterm:\
    :@7=\EOF:@8=\EOM:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
    :k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
    :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kI=\E[2~:\
    :kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:\
    :tc=xterm-basic:
....
xterm-basic|modern xterm common:\
    :am:bs:km:mi:ms:ut:xn:AX:\
    :Co#8:co#80:kn#12:li#24:pa#64:\
    :AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\
    :DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\
    :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
    :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\
    :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\
    :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:kB=\E[Z:le=^H:md=\E[1m:\
    :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\
    :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\
    :so=\E[7m:sr=\EM:st=\EH:\
    :ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:vs=\E[?12;25h:

If you insist on terminfo(5) sources on FreeBSD there is one which comes with ncurses: /usr/src/contrib/ncurses/misc/terminfo.src

In case you don't have /usr/src populated: fetch https://svn.freebsd.org/base/releng/12.2/contrib/ncurses/misc/terminfo.src
 
Last edited:
My apologies, but I was under the impression you are going to use the source files describing terminals to see what field corresponds to the "\E[D" sequence for your x11/xterm terminal, all for FreeBSD usage.
You are absolutely right.

I really don't understand what's going on.
In order not to change the subject, I will open a new topic about the mysterious appearance of these ansi codes.

Thank you for answering my question!
 
Whilst FreeBSD base uses termcap, some ports etc. can be configured to use terminfo.

ogogon, at the time of your post, the FreeBSD ncurses port used a compiled terminfo at /usr/local/share/misc/terminfo.db

If your program was using terminfo, you'd have had to try and decompile that file (bdb 1.85 format)

Currently, ncurses from ports no longer uses terminfo.db - it will use terminfo files if installed, but fall back to termcap otherwise. To use terminfo in this case, install port misc/terminfo-db

Then the files would be installed under /usr/local/share/terminfo/*/*
 
Back
Top