[net.sources] skeleton termcap entry

frew@ucsbcsl.UUCP (08/01/84)

The following is the skeleton file I use to construct new termcap
entries on our 4.2BSD system.  It is based partly on termcap(5), partly
on rooting around in the innards of some of the more prominent
termcap-using programs, and partly on hard knocks.  When I finished
this I was surprised at the number of undocumented capabilities that
are used by existing software (e.g., AL and DL really speed up vi on
ANSI terminals).

For those of you who are new to termcap, I recommend the series of
articles by Bill Tuthill in UNIX/WORLD, beginning with the
January/February 1984 issue.

(cut here)
-------------------------------------------------------------------------------
Termcap codes

XX|visible name|aliases|full name

used by "vi"

AL=	P*	add N new blank lines (same syntax as "cm")
al=	P*	add new blank line (pad if using "sr")
am		has automatic margins
bc=		backspace (specify ONLY if not ^H)
bs		can backspace with ^H
bt=	P	back tab
cd=	P*	clear to end of display
ce=	P	clear to end of line
cl=	P*	clear entire screen, leave cursor at home position
cm=	P	cursor motion
co#		number of columns in a line
cr=	P*	carriage return (specify ONLY if not ^M)
cs=	P	change scrolling region (e.g., vt100) (same syntax as "cm")
da		display may be retained above
db		display may be retained below
dc=	P*	delete character
DL=	P*	delete N lines (same syntax as "cm")
dl=	P*	delete line
dm=		delete mode begin
DO=		down N lines (same syntax as "cm")
do=		down line
ed=		end delete mode
ei=		end insert mode (specify ":ei=:" if using "ic")
eo		can erase overstrikes with a blank
hc		hard copy terminal
ho=		home cursor
hz		Hazeltine: can't print ~'s
ic=	P	insert character
			(NOTE: if both "ic" and "im","ei" are available,
			specify "im","ei" and DON'T specify "ic")
im=		insert mode (specify ":im=:" if using "ic")
in		insert mode distinguishes nulls on display
ip=	P*	insert pad after character inserted using "im" + "ei"
k0=		sent by function key 0
k1=		sent by function key 1
k2=		sent by function key 2
k3=		sent by function key 3
k4=		sent by function key 4
k5=		sent by function key 5
k6=		sent by function key 6
k7=		sent by function key 7
k8=		sent by function key 8
k9=		sent by function key 9
kd=		sent by keypad down arrow
ke=		end keypad transmit mode
			(NOTE: see "ks" below)
kh=		sent by keypad home key
kl=		sent by keypad left arrow
kr=		sent by keypad right arrow
ks=		start keypad transmit mode
			(NOTE: DON'T specify "ks" and "ke" unless you want them
			to be used by vi)
ku=		keypad up arrow
LE=		left N chars (same syntax as "cm")
li#		number of lines on screen or page
ll=		quick to last line, first column
mi		safe to move while in insert mode
nc		no cr: \r sends \r\n then eats \n (e.g., dm2500)
nd=		non-destructive space
nl=		newline (line feed) (specify ONLY if not ^J)
ns		terminal is a CRT but doesn't scroll
os		terminal overstrikes
pc=		pad character (specify ONLY if not '\0')
RI=		right N spaces (same syntax as "cm")
rc=		restore cursor from last "sc"
sc=		save cursor
se=		stand-out mode end (may leave space)
sf=	P	scroll forwards
so=		stand-out mode begin (may leave space)
sr=	P	scroll reverse (backwards)
ta=	P	tab (specify ONLY if padded or not ^I)
te=		terminal end sequence
ti=		terminal initial sequence
UP=		up N lines (same syntax as "cm")
ul		terminal underlines even though it doesn't overstrike
up=		upline (cursor up)
vb=		visible bell (may not move cursor)
ve=		visual mode end sequence
vs=		visual mode start sequence
xb		Beehive glitch: no escape key, simulate with f1
xn		newline glitch: \n gets eaten after wrap (e.g., concept)
xt		tab glitch: tabs are destructive
xx		Tektronix glitch: special insert line

additional codes used by "tset"

EP		even parity
HD		half duplex
LC		lower case only
NL		\n doesn't do a line feed
OP		odd parity
UC		upper case only
ch=	P	cursor horizontal move (same syntax as "cm")
ct=		clear tabs
if=		name of file containing "is"
is=		terminal initialization string
kb=		sent by backspace key
pb#		pad baud (min baud rate at which padding is required)
pt		has hardware tabs (may need to be set with "is")
rf=		name of file containing "rs"
rs=		terminal reset string (used instead of "is" by reset)
st=		set tab at current cursor position
vt#		virtual terminal number (UCB-specific)

additional codes used by "sysline"

ds=		disable status line
es		OK to use escape codes on status line ("se", "so", "cm", etc.)
fs=		return from status line
hs		has status line
i2=		supplemental initialization string (like "is")
ts=		go to status line

additional codes used by "more"

uc=		underscore one character and move past it
ue=		underscore mode end
us=		underscore mode start
xs		stand-out not erased by writing over it (e.g., HP264x)

additional codes used by "ul"

le=		cursor left (default: "bc" or \b)
md=		set mode to double intensity
me=		restore "m?" modes to normal
mh=		set mode to half-intensity
mr=		set mode to reverse video
ri=		cursor right (default: "nd")

additional codes documented but not used by any of the above

ae=	P	end alternate character set
as=	P	start alternate character set
bw		backspace wraps from column 0 to last column
cv=	P	cursor vertical move (same syntax as "cm")
dB#		number of millisec of "bs" delay needed
dC#		number of millisec of "cr" delay needed
dF#		number of millisec of "ff" delay needed
dN#		number of millisec of "nl" delay needed
dT#		number of millisec of "ta" delay needed
ff=	P*	hardcopy terminal page eject (specify ONLY if not ^L)
hd=		half-line down (forward 1/2 linefeed)
hu=		half-line up (reverse 1/2 linefeed)
kn#		number of function keys
ko=		termcap entries for non-function keys
l0=		label on function key 0, if not "f0"
l1=		label on function key 1, if not "f1"
l2=		label on function key 2, if not "f2"
l3=		label on function key 3, if not "f3"
l4=		label on function key 4, if not "f4"
l5=		label on function key 5, if not "f5"
l6=		label on function key 6, if not "f6"
l7=		label on function key 7, if not "f7"
l8=		label on function key 8, if not "f8"
l9=		label on function key 9, if not "f9"
ma=		arrow key map (vi version 2 only)
ml=		memory lock on insert mode cursor
ms		safe to move while in standout and underline mode
mu=		memory unlock (inverse of "ml")
sg#		number of blank characters left by "so" or "se"
ug#		number of blank characters left by "us" or "ue"
xr		\r acts like "ce"\r\n (e.g., Delta Data)
-------------------------------------------------------------------------------
-- 
James Frew
Computer Systems Laboratory
University of California
Santa Barbara, CA 93106

(805) 961-2309 (machine answers "Snowmelt Project")

ucbvax!ucsbcsl!frew