xref: /onnv-gate/usr/src/cmd/terminfo/README (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#
2*0Sstevel@tonic-gate# CDDL HEADER START
3*0Sstevel@tonic-gate#
4*0Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*0Sstevel@tonic-gate# with the License.
8*0Sstevel@tonic-gate#
9*0Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate# See the License for the specific language governing permissions
12*0Sstevel@tonic-gate# and limitations under the License.
13*0Sstevel@tonic-gate#
14*0Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate#
20*0Sstevel@tonic-gate# CDDL HEADER END
21*0Sstevel@tonic-gate#
22*0Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"	SVr4.0 1.6
23*0Sstevel@tonic-gate#	From:	SVr4.0	terminfo:README	1.6
24*0Sstevel@tonic-gate
25*0Sstevel@tonic-gate
26*0Sstevel@tonic-gate1	Within the curses component, exists other conversion tools which are
27*0Sstevel@tonic-gate	much more robust than those described below. They are called infocmp,
28*0Sstevel@tonic-gate	and captoinfo. The cvt files are provided here only for those possible
29*0Sstevel@tonic-gate	cases where a user has the terminfo component without the libcurses
30*0Sstevel@tonic-gate	component.
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate	The captoinfo and infocmp utilities cannot be included here, as they
33*0Sstevel@tonic-gate	require the user to have libcurses. Although we know of no instance
34*0Sstevel@tonic-gate	when a user would have one and not the other, we have provided the
35*0Sstevel@tonic-gate	cvt files (described below) for those limited cases.
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gate2	The files in this directory with the .ti suffix are terminfo sources.
40*0Sstevel@tonic-gate	They should be compiled (separately or by catting them together into
41*0Sstevel@tonic-gate	terminfo.src) with tic, placing the results in /usr/lib/terminfo.
42*0Sstevel@tonic-gate	Please send any updates to AT&T Bell Laboratories UNIX support,
43*0Sstevel@tonic-gate	via UNIX mail to attunix!terminfo.
44*0Sstevel@tonic-gate
45*0Sstevel@tonic-gate
46*0Sstevel@tonic-gate
47*0Sstevel@tonic-gate3	The cvt files are useful tools for converting termcap to terminfo.
48*0Sstevel@tonic-gate	They are not 100% accurate, but do most of the conversion for you.
49*0Sstevel@tonic-gate	cvt.ex is an ex script to convert a termcap description into a
50*0Sstevel@tonic-gate	terminfo description.  Note that it will not convert padding
51*0Sstevel@tonic-gate	specifications, so they must be done by hand.  Note also that typical
52*0Sstevel@tonic-gate	termcap entries do not give as much information as terminfo, so the
53*0Sstevel@tonic-gate	resulting terminfo entry is often incomplete (e.g. won't tell you the
54*0Sstevel@tonic-gate	terminal uses xon/xoff handshaking, or what extra function keys send).
55*0Sstevel@tonic-gate	You are urged to read the list of terminfo capabilities and augment your
56*0Sstevel@tonic-gate	terminfo descriptions accordingly.
57*0Sstevel@tonic-gate
58*0Sstevel@tonic-gate	The cvt.h file is useful for a quick hack at converting termcap programs
59*0Sstevel@tonic-gate	which use uppercase 2 letter names for capabilities to use terminfo.
60*0Sstevel@tonic-gate	Since tget* are provided anyway, this is of questionable value unless
61*0Sstevel@tonic-gate	your program barely fits on a pdp-11.
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate	The cvt.sed script is useful for actually editing the source of the same
64*0Sstevel@tonic-gate	class of programs.  It requires a sed that understands \< and \>, the
65*0Sstevel@tonic-gate	mod is trivial to make if you look at the corresponding code in ex or
66*0Sstevel@tonic-gate	grep.
67*0Sstevel@tonic-gate
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate
70*0Sstevel@tonic-gate3	There are other incompatibilities at the user level between termcap and
71*0Sstevel@tonic-gate	terminfo.  A program which creates a termcap description and then
72*0Sstevel@tonic-gate	passes it to tgetent (e.g. vi used to do this if no TERM was set) or
73*0Sstevel@tonic-gate	which puts such a description in the environment for a child cannot
74*0Sstevel@tonic-gate	possibly work, since terminfo puts the parser into the compiler, not
75*0Sstevel@tonic-gate	the user program.  If you want to give a child a smaller window, set
76*0Sstevel@tonic-gate	up the LINES and COLUMNS environment variables or implement the JWINSIZE
77*0Sstevel@tonic-gate	ioctl.
78*0Sstevel@tonic-gate
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate
81*0Sstevel@tonic-gate4	If you want to edit your own personal terminfo descriptions (and are not
82*0Sstevel@tonic-gate	a super user on your system) the method is different.  Set
83*0Sstevel@tonic-gate	TERMINFO=$HOME/term (or wherever you put the compiled tree) in your
84*0Sstevel@tonic-gate	environment, then compile your source with tic.  Tic and user programs
85*0Sstevel@tonic-gate	will check in $TERMINFO before looking in /usr/lib/terminfo/*/*
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gate
88*0Sstevel@tonic-gate
89*0Sstevel@tonic-gate5	Philosophy in adding new terminfo capabilities:
90*0Sstevel@tonic-gate
91*0Sstevel@tonic-gate	Capabilities were cheap in termcap, since no code supported them
92*0Sstevel@tonic-gate	and they need only be documented.  In terminfo, they add size to
93*0Sstevel@tonic-gate	the structure and the binaries, so don't add them in mass quantities.
94*0Sstevel@tonic-gate
95*0Sstevel@tonic-gate	Add a capability only if there is an application that wants to use it.
96*0Sstevel@tonic-gate	Lots of terminals have a half duplex forms editing mode, but no UNIX
97*0Sstevel@tonic-gate	applications use it, so we don't include it.
98*0Sstevel@tonic-gate
99*0Sstevel@tonic-gate	Before you add a capability, try to hold off until there are at least
100*0Sstevel@tonic-gate	2 or 3 different terminals implementing similar features.  That way,
101*0Sstevel@tonic-gate	you can get a better idea of the general model that the capability
102*0Sstevel@tonic-gate	should have, rather than coming up with something that only works
103*0Sstevel@tonic-gate	on one kind of terminal.  For example, the status line capabilities
104*0Sstevel@tonic-gate	were added after we had seen the h19, the tvi950, and the vt100 run
105*0Sstevel@tonic-gate	sysline.  The original program, called h19sys, only worked on an h19
106*0Sstevel@tonic-gate	and addressed the cursor to line 25.  This model doesn't fit other
107*0Sstevel@tonic-gate	terminals with a status line.
108*0Sstevel@tonic-gate
109*0Sstevel@tonic-gate	Note that capabilities must be added at the end of ../screen/caps.
110*0Sstevel@tonic-gate	Furthermore, if you add a private capability, you should check with
111*0Sstevel@tonic-gate	someone to make sure your capability goes into the master file,
112*0Sstevel@tonic-gate	otherwise someone else will add a different capability and
113*0Sstevel@tonic-gate	compatibility between two systems is destroyed.  There must be one
114*0Sstevel@tonic-gate	master set of capabilities. This list is maintained at AT&T UNIX
115*0Sstevel@tonic-gate	Development. Comments should be sent to attunix!terminfo.
116*0Sstevel@tonic-gate
117*0Sstevel@tonic-gate
118*0Sstevel@tonic-gate
119*0Sstevel@tonic-gate6	Current murky areas include:
120*0Sstevel@tonic-gate
121*0Sstevel@tonic-gate	Color - there is demand for colors but it isn't clear what to do yet.
122*0Sstevel@tonic-gate	Some terminals support only 2 or 4 or 8 or 16 colors, others have a
123*0Sstevel@tonic-gate	palette of some huge selection.  What are the standard colors?  How
124*0Sstevel@tonic-gate	does graphics fit into this (terminfo is alphanumeric oriented?)
125*0Sstevel@tonic-gate	Curses can have another 16 bits added, or some routine set to decide
126*0Sstevel@tonic-gate	which 9 attribute bits have meaning in any given program.  An
127*0Sstevel@tonic-gate	alternative is that if you just want color alphanumerics for a simple
128*0Sstevel@tonic-gate	application, e.g. highlighting certain fields, decide how you would
129*0Sstevel@tonic-gate	want your application to behave on a B/W terminal (e.g. a vt100),
130*0Sstevel@tonic-gate	using reverse for one thing, blinking for another, bold for another,
131*0Sstevel@tonic-gate	invisible for another, etc.
132*0Sstevel@tonic-gate	(Invis may be useful for colored fields with no information in them.)
133*0Sstevel@tonic-gate	Then make a terminfo entry with blink=xxx, bold=yyy, etc, where xxx
134*0Sstevel@tonic-gate	and yyy are sequences to go into the colors you really want.  This way
135*0Sstevel@tonic-gate	your application also works on B/W terminals.
136*0Sstevel@tonic-gate
137*0Sstevel@tonic-gate	Graphics: Giles Billingsley at Berkeley did something called MFBCAP
138*0Sstevel@tonic-gate	once, it was like termcap but 3 times as big and handled graphics.
139*0Sstevel@tonic-gate	I don't think it was ever finished.  I don't know how to do graphics
140*0Sstevel@tonic-gate	in curses, one might add it to terminfo at very high cost.
141*0Sstevel@tonic-gate
142*0Sstevel@tonic-gate	Input: things that send escape sequences to your program to be decoded
143*0Sstevel@tonic-gate	are a hard issue.  You have to somehow deal with typeahead and with
144*0Sstevel@tonic-gate	terminals that can't do it.  This includes "request cursor position",
145*0Sstevel@tonic-gate	for which a better solution is to immediately address the cursor to
146*0Sstevel@tonic-gate	a known position.  (Curses also has filter mode that won't assume
147*0Sstevel@tonic-gate	the line but will assume the column.)  Mice also fall into this
148*0Sstevel@tonic-gate	category.  Scanf style strings (tparm is printf style) might be able
149*0Sstevel@tonic-gate	to decode these sequences, but I have no experience with them.
150*0Sstevel@tonic-gate
151*0Sstevel@tonic-gate	Alternate character set: the vt100 set seems to be becoming a defacto
152*0Sstevel@tonic-gate	standard, although it doesn't do much.  I almost standardized on the
153*0Sstevel@tonic-gate	Teletype 5410, which was a nice superset of the vt100, but then Teletype
154*0Sstevel@tonic-gate	updated the 5410 to make it a vt100 duplicate, so now all I've put in
155*0Sstevel@tonic-gate	are the vt100 line drawing characters.  HP has a more complete set,
156*0Sstevel@tonic-gate	but it has some really weird things in it and the mappings are
157*0Sstevel@tonic-gate	nonstandard.
158*0Sstevel@tonic-gate	Any extension should be able to handle both kinds of terminals, and
159*0Sstevel@tonic-gate	handle common programs without assuming an HP (or even a vt100).
160*0Sstevel@tonic-gate
161*0Sstevel@tonic-gate	------------------------------------
162*0Sstevel@tonic-gate
163*0Sstevel@tonic-gate
164*0Sstevel@tonic-gate7	Additional modules:
165*0Sstevel@tonic-gate
166*0Sstevel@tonic-gate		ckout		shell script, analyzes file errs for diagnostics
167*0Sstevel@tonic-gate				and displays number of entries built
168*0Sstevel@tonic-gate
169*0Sstevel@tonic-gate		Doc.sed		sed script to be run on ti files.
170*0Sstevel@tonic-gate				prints documentation of ti files.
171