xref: /freebsd/contrib/file/magic/Magdir/terminfo (revision ae316d1d1cffd71ab7751f94e10118777a88e027)
1b6cee71dSXin LI
2b6cee71dSXin LI#------------------------------------------------------------------------------
3*ae316d1dSXin LI# $File: terminfo,v 1.14 2024/09/04 19:06:12 christos Exp $
4b6cee71dSXin LI# terminfo:  file(1) magic for terminfo
5b6cee71dSXin LI#
648c779cdSXin LI# URL: https://invisible-island.net/ncurses/man/term.5.html
748c779cdSXin LI# URL: https://invisible-island.net/ncurses/man/scr_dump.5.html
8b6cee71dSXin LI#
940427ccaSGordon Tetlow# Workaround for Targa image type by Joerg Jenderek
103e41d09dSXin LI# GRR: line below too general as it catches also
113e41d09dSXin LI# Targa image type 1 with 26 long identification field
123e41d09dSXin LI# and HELP.DSK
133e41d09dSXin LI0	string		\032\001
143e41d09dSXin LI# 5th character of terminal name list, but not Targa image pixel size (15 16 24 32)
153e41d09dSXin LI>16	ubyte		>32
163e41d09dSXin LI# namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0.4.1"
173e41d09dSXin LI>>12	regex		\^[a-zA-Z0-9][a-zA-Z0-9.][^|]*	Compiled terminfo entry "%-s"
183e41d09dSXin LI!:mime	application/x-terminfo
193e41d09dSXin LI# no extension
203e41d09dSXin LI#!:ext
2140427ccaSGordon Tetlow#
2258a0f0d0SEitan Adler#------------------------------------------------------------------------------
2358a0f0d0SEitan Adler# The following was added for ncurses6 development:
2458a0f0d0SEitan Adler#------------------------------------------------------------------------------
2558a0f0d0SEitan Adler#
2658a0f0d0SEitan Adler0	string		\036\002
2758a0f0d0SEitan Adler# imitate the legacy compiled-format, to get the entry-name printed
2858a0f0d0SEitan Adler>16	ubyte		>32
2958a0f0d0SEitan Adler# namelist, if more than 1 separated by "|" like "st|stterm| simpleterm 0. 4.1"
3058a0f0d0SEitan Adler>>12	regex		\^[a-zA-Z0-9][a-zA-Z0-9.][^|]*	Compiled 32-bit terminfo entry "%-s"
3158a0f0d0SEitan Adler!:mime	application/x-terminfo2
3258a0f0d0SEitan Adler#
3343a5ec4eSXin LI# While the compiled terminfo uses little-endian format regardless of
3440427ccaSGordon Tetlow# platform, SystemV screen dumps do not.  They came later, and that detail was
3540427ccaSGordon Tetlow# overlooked.
3640427ccaSGordon Tetlow#
3740427ccaSGordon Tetlow# AIX and HPUX use the SVr4 big-endian format
3840427ccaSGordon Tetlow# Solaris uses the SVr3 formats (sparc and x86 differ endian-ness)
3940427ccaSGordon Tetlow0	beshort		0433 		SVr2 curses screen image, big-endian
40898496eeSXin LI# GRR: line below too general as it catches Commodore C128 program (crc32.prg XLINK.PRG) with start address 1C01h handled by ./c64
4140427ccaSGordon Tetlow0	beshort		0434		SVr3 curses screen image, big-endian
4240427ccaSGordon Tetlow0	beshort		0435		SVr4 curses screen image, big-endian
4340427ccaSGordon Tetlow#
4440427ccaSGordon Tetlow0	leshort		0433		SVr2 curses screen image, little-endian
4540427ccaSGordon Tetlow0	leshort		0434		SVr3 curses screen image, little-endian
4640427ccaSGordon Tetlow0	leshort		0435		SVr4 curses screen image, little-endian
4740427ccaSGordon Tetlow#
4840427ccaSGordon Tetlow# Rather than SVr4, Solaris "xcurses" writes this header:
4940427ccaSGordon Tetlow0	regex		\^MAX=[0-9]+,[0-9]+$
5040427ccaSGordon Tetlow>1	regex		\^BEG=[0-9]+,[0-9]+$
51*ae316d1dSXin LI>>2	regex		\^SCROLL=[0-9]+,[0-9]+$
52*ae316d1dSXin LI>>>3	regex		\^VMIN=[0-9]+$
53*ae316d1dSXin LI>>>>4	regex		\^VTIME=[0-9]+$
54*ae316d1dSXin LI>>>>>5	regex		\^FLAGS=0x[[:xdigit:]]+$
55*ae316d1dSXin LI>>>>>>6	regex		\^FG=[0-9],[0-9]+$
56*ae316d1dSXin LI>>>>>>>7	regex		\^BG=[0-9]+,[0-9]+,	Solaris xcurses screen image
5740427ccaSGordon Tetlow#
5840427ccaSGordon Tetlow# ncurses5 (and before) did not use a magic number, making screen dumps "data".
5940427ccaSGordon Tetlow# ncurses6 (2015) uses this format, ignoring byte-order
6040427ccaSGordon Tetlow0	string	\210\210\210\210ncurses	ncurses6 screen image
6140427ccaSGordon Tetlow#
6240427ccaSGordon Tetlow# PDCurses added this in 2005
6340427ccaSGordon Tetlow0	string		PDC\001		PDCurses screen image
64