xref: /freebsd/share/termcap/termcap.5 (revision 7bd6fde3)
1.\" Copyright (c) 1985, 1991, 1993, 1994
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\"    must display the following acknowledgement:
14.\"	This product includes software developed by the University of
15.\"	California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\"    may be used to endorse or promote products derived from this software
18.\"    without specific prior written permission.
19.\"
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\"     @(#)termcap.5	8.3 (Berkeley) 4/16/94
33.\"
34.\" /***************************************************************************
35.\" *                            COPYRIGHT NOTICE                              *
36.\" ****************************************************************************
37.\" *                ncurses is copyright (C) 1992-1995                        *
38.\" *                          Zeyd M. Ben-Halim                               *
39.\" *                          zmbenhal@netcom.com                             *
40.\" *                          Eric S. Raymond                                 *
41.\" *                          esr@snark.thyrsus.com                           *
42.\" *                                                                          *
43.\" *        Permission is hereby granted to reproduce and distribute ncurses  *
44.\" *        by any means and for any fee, whether alone or as part of a       *
45.\" *        larger distribution, in source or in binary form, PROVIDED        *
46.\" *        this notice is included with any such distribution, and is not    *
47.\" *        removed from any of its header files. Mention of ncurses in any   *
48.\" *        applications linked with it is highly appreciated.                *
49.\" *                                                                          *
50.\" *        ncurses comes AS IS with no warranty, implied or expressed.       *
51.\" *                                                                          *
52.\" ***************************************************************************/
53.\"
54.\" $FreeBSD$
55.\"
56.Dd April 16, 1994
57.Dt TERMCAP 5
58.Os
59.Sh NAME
60.Nm termcap
61.Nd terminal capability data base
62.Sh SYNOPSIS
63.Nm
64.Sh DESCRIPTION
65The
66.Nm
67file
68is a data base describing terminals,
69used,
70for example,
71by
72.Xr \&vi 1
73and
74.Xr ncurses 3 .
75Terminals are described in
76.Nm
77by giving a set of capabilities that they have and by describing
78how operations are performed.
79Padding requirements and initialization sequences
80are included in
81.Nm .
82.Pp
83Entries in
84.Nm
85consist of a number of `:'-separated fields.
86The first entry for each terminal gives the names that are known for the
87terminal, separated by `|' characters.
88The first name given is the most common abbreviation for the terminal.
89The last name given should be a long name fully identifying the terminal,
90and all others are understood as synonyms for the terminal name.
91All names but the last should be in lower case and contain no blanks;
92the last name may well contain upper case characters and blanks for
93readability.
94.Pp
95Terminal names (except for the last, verbose entry)
96should be chosen using the following conventions.
97The particular piece of hardware making up the terminal
98should have a root name chosen, thus
99.Dq hp2621
100This name should not contain hyphens.
101Modes that the hardware can be in
102or user preferences
103should be indicated by appending a hyphen and an indicator of the mode.
104Therefore, a
105.Dq vt100
106in 132-column mode would be
107.Dq vt100-w .
108The following suffixes should be used where possible:
109.Pp
110.Bl -column indent "With automatic margins (usually default)xx" -offset indent
111.Sy "Suffix	Meaning	Example"
112-w	Wide mode (more than 80 columns)	vt100-w
113-am	With automatic margins (usually default)	vt100-am
114-nam	Without automatic margins	vt100-nam
115.Pf \- Ar n Ta No "Number of lines on screen	aaa-60"
116-na	No arrow keys (leave them in local)	concept100-na
117.Pf \- Ar \&np Ta No "Number of pages of memory	concept100-4p"
118-rv	Reverse video	concept100-rv
119.El
120.Sh CAPABILITIES
121The description field attempts to convey the semantics of the
122capability.
123You may find some codes in the description field:
124.Pp
125.Bl -tag -width #[1-9]
126.It (P)
127indicates that padding may be specified.
128.It #[1-9]
129in the description field indicates that the string is passed through
130.Xr tparm 3
131or
132.Xr tgoto 3
133with parms as given (#\fIi\fP).
134.It (P*)
135indicates that padding may vary in proportion to the number of
136lines affected.
137.It (#\d\fIi\fP\u)
138indicates the \fIi\fP\uth\d parameter.
139.El
140.Pp
141These are the boolean capabilities:
142.Bd -literal
143\fBBoolean			TCap	Description\fR
144\fBVariables		Code\fR
145auto_left_margin	bw	cursor_left wraps from column 0	to last
146				column
147auto_right_margin	am	terminal has automatic margins
148no_esc_ctlc		xb	beehive	(f1=escape, f2=ctrl C)
149ceol_standout_glitch	xs	standout not erased by overwriting (hp)
150eat_newline_glitch	xn	newline	ignored	after 80 cols (concept)
151erase_overstrike	eo	can erase overstrikes with a blank
152generic_type		gn	generic	line type
153hard_copy		hc	hardcopy terminal
154has_meta_key		km	Has a meta key,	sets msb high
155has_status_line		hs	has extra status line
156insert_null_glitch	in	insert mode distinguishes nulls
157memory_above		da	display	may be retained	above the screen
158memory_below		db	display	may be retained	below the screen
159move_insert_mode	mi	safe to	move while in insert mode
160move_standout_mode	ms	safe to	move while in standout mode
161over_strike		os	terminal can overstrike
162status_line_esc_ok	es	escape can be used on the status line
163dest_tabs_magic_smso	xt	tabs destructive, magic	so char	(t1061)
164tilde_glitch		hz	cannot print ~'s (hazeltine)
165transparent_underline	ul	underline character overstrikes
166xon_xoff		xo	terminal uses xon/xoff handshaking
167needs_xon_xoff		nx	padding	will not work, xon/xoff required
168prtr_silent		5i	printer	will not echo on screen
169hard_cursor		HC	cursor is hard to see
170non_rev_rmcup		NR	enter_ca_mode does not reverse exit_ca_mode
171no_pad_char		NP	pad character does not exist
172non_dest_scroll_region	ND	scrolling region is non-destructive
173can_change		cc	terminal can re-define existing	colors
174back_color_erase	ut	screen erased with background color
175hue_lightness_saturation	hl	terminal uses only HLS color
176					notation (tektronix)
177col_addr_glitch		YA	only positive motion for column	address	and
178				micro_column_address caps
179cr_cancels_micro_mode	YB	using cr turns off micro mode
180has_print_wheel		YC	printer	needs operator to change character
181				set
182row_addr_glitch		YD	only positive motion for row_address and
183				micro_row_address caps
184semi_auto_right_margin	YE	printing in last column	causes cr
185cpi_changes_res		YF	changing character pitch changes resolution
186lpi_changes_res		YG	changing line pitch changes resolution
187.Ed
188.Pp
189These are the numeric capabilities:
190.Bd -literal
191\fBNumeric			TCap	Description\fR
192\fBVariables		Code\fR
193columns			co	number of columns in aline
194init_tabs		it	tabs initially every # spaces
195lines			li	number of lines	on screen or page
196lines_of_memory		lm	lines of memory	if > line. 0 =>	varies
197magic_cookie_glitch	sg	number of blank	chars left by
198				enter_standout_mode or exit_standout_mode
199padding_baud_rate	pb	lowest baud rate where padding needed
200virtual_terminal	vt	virtual	terminal number	(CB/unix)
201width_status_line	ws	columns	in status line
202num_labels		Nl	number of labels on screen
203label_height		lh	rows in	each label
204label_width		lw	columns	in each	label
205max_attributes		ma	maximum	combined attributes terminal can
206				handle
207maximum_windows		MW	maximum	number of definable windows
208magic_cookie_glitch_ul	ug	number of blanks left by underline
209#
210# These came in with SVr4's color support
211#
212max_colors		Co	maximum	numbers	of colors on screen
213max_pairs		pa	maximum	number of color-pairs on the screen
214no_color_video		NC	video attributes that cannot be used with
215				colors
216#
217# The following	numeric	capabilities are present in the	SVr4.0 term
218# structure, but are not yet documented	in the man page.
219# They came in with SVr4's printer support.
220#
221buffer_capacity		Ya	numbers	of bytes buffered before printing
222dot_vert_spacing	Yb	spacing	of pins	vertically in pins per inch
223dot_horz_spacing	Yc	spacing	of dots	horizontally in	dots per
224				inch
225max_micro_address	Yd	maximum	value in micro_..._address
226max_micro_jump		Ye	maximum	value in parm_..._micro
227micro_char_size		Yf	character size when in micro mode
228micro_line_size		Yg	line size when in micro	mode
229number_of_pins		Yh	numbers	of pins	in print-head
230output_res_char		Yi	horizontal resolution in units per line
231output_res_line		Yj	vertical resolution in units per line
232output_res_horz_inch	Yk	horizontal resolution in units per inch
233output_res_vert_inch	Yl	vertical resolution in units per inch
234print_rate		Ym	print rate in chars per	second
235wide_char_size		Yn	character step size when in double wide
236				mode
237buttons			BT	number of buttons on mouse
238bit_image_entwining	Yo	number of passed for each bit-image row
239bit_image_type		Yp	type of	bit-image device
240.Ed
241.Pp
242These are the string capabilities:
243.Bd -literal
244\fBString			TCap	Description\fR
245\fBVariables		Code\fR
246back_tab		bt	back tab (P)
247bell			bl	audible	signal (bell) (P)
248carriage_return		cr	carriage return	(P*)
249change_scroll_region	cs	change region to line #1 to line #2 (P)
250clear_all_tabs		ct	clear all tab stops (P)
251clear_screen		cl	clear screen and home cursor (P*)
252clr_eol			ce	clear to end of	line (P)
253clr_eos			cd	clear to end of	screen (P*)
254column_address		ch	horizontal position #1,	absolute (P)
255command_character	CC	terminal settable cmd character	in
256				prototype
257cursor_address		cm	move to	row #1 columns #2
258cursor_down		do	down one line
259cursor_home		ho	home cursor
260cursor_invisible	vi	make cursor invisible
261cursor_left		le	move left one space
262cursor_mem_address	CM	memory relative	cursor addressing
263cursor_normal		ve	make cursor appear normal (undo
264				cursor_invisible/cursor_visible)
265cursor_right		nd	move right one space
266cursor_to_ll		ll	last line, first column
267cursor_up		up	up one line
268cursor_visible		vs	make cursor very visible
269delete_character	dc	delete character (P*)
270delete_line		dl	delete line (P*)
271dis_status_line		ds	disable	status line
272down_half_line		hd	half a line down
273enter_alt_charset_mode	as	start alternate	character set (P)
274enter_blink_mode	mb	turn on	blinking
275enter_bold_mode		md	turn on	bold (extra bright) mode
276enter_ca_mode		ti	string to start	programs using
277				cursor_address
278enter_delete_mode	dm	enter delete mode
279enter_dim_mode		mh	turn on	half-bright mode
280enter_insert_mode	im	enter insert mode
281enter_secure_mode	mk	turn on	blank mode (characters invisible)
282enter_protected_mode	mp	turn on	protected mode
283enter_reverse_mode	mr	turn on	reverse	video mode
284enter_standout_mode	so	begin standout mode
285enter_underline_mode	us	begin underline	mode
286erase_chars		ec	erase #1 characters (P)
287exit_alt_charset_mode	ae	end alternate character	set (P)
288exit_attribute_mode	me	turn off all attributes
289exit_ca_mode		te	strings	to end programs	using cup
290exit_delete_mode	ed	end delete mode
291exit_insert_mode	ei	exit insert mode
292exit_standout_mode	se	exit standout mode
293exit_underline_mode	ue	exit underline mode
294flash_screen		vb	visible	bell (may not move cursor)
295form_feed		ff	hardcopy terminal page eject (P*)
296from_status_line	fs	return from status line
297init_1string		i1	initialization string
298init_2string		is	initialization string
299init_3string		i3	initialization string
300init_file		if	name of	initialization file
301insert_character	ic	insert character (P)
302insert_line		al	insert line (P*)
303insert_padding		ip	insert padding after inserted character
304key_backspace		kb	backspace key
305key_catab		ka	clear-all-tabs key
306key_clear		kC	clear-screen or	erase key
307key_ctab		kt	clear-tab key
308key_dc			kD	delete-character key
309key_dl			kL	delete-line key
310key_down		kd	down-arrow key
311key_eic			kM	sent by	rmir or	smir in	insert mode
312key_eol			kE	clear-to-end-of-line key
313key_eos			kS	clear-to-end-of-screen key
314key_f0			k0	F0 function key
315key_f1			k1	F1 function key
316key_f10			k;	F10 function key
317key_f2			k2	F2 function key
318key_f3			k3	F3 function key
319key_f4			k4	F4 function key
320key_f5			k5	F5 function key
321key_f6			k6	F6 function key
322key_f7			k7	F7 function key
323key_f8			k8	F8 function key
324key_f9			k9	F9 function key
325key_home		kh	home key
326key_ic			kI	insert-character key
327key_il			kA	insert-line key
328key_left		kl	left-arrow key
329key_ll			kH	last-line key
330key_npage		kN	next-page key
331key_ppage		kP	prev-page key
332key_right		kr	right-arrow key
333key_sf			kF	scroll-forward key
334key_sr			kR	scroll-backward	key
335key_stab		kT	set-tab	key
336key_up			ku	up-arrow key
337keypad_local		ke	leave 'keyboard_transmit' mode
338keypad_xmit		ks	enter 'keyboard_transmit' mode
339lab_f0			l0	label on function key f0 if not	f0
340lab_f1			l1	label on function key f1 if not	f1
341lab_f10			la	label on function key f10 if not f10
342lab_f2			l2	label on function key f2 if not	f2
343lab_f3			l3	label on function key f3 if not	f3
344lab_f4			l4	label on function key f4 if not	f4
345lab_f5			l5	label on function key f5 if not	f5
346lab_f6			l6	label on function key f6 if not	f6
347lab_f7			l7	label on function key f7 if not	f7
348lab_f8			l8	label on function key f8 if not	f8
349lab_f9			l9	label on function key f9 if not	f9
350meta_off		mo	turn off meta mode
351meta_on			mm	turn on	meta mode (8th-bit on)
352newline			nw	newline	(behave	like cr	followed by lf)
353pad_char		pc	padding	char (instead of null)
354parm_dch		DC	delete #1 chars	(P*)
355parm_delete_line	DL	delete #1 lines	(P*)
356parm_down_cursor	DO	down #1	lines (P*)
357parm_ich		IC	insert #1 chars	(P*)
358parm_index		SF	scroll forward #1 lines	(P)
359parm_insert_line	AL	insert #1 lines	(P*)
360parm_left_cursor	LE	move #1	chars to the left (P)
361parm_right_cursor	RI	move #1	chars to the right (P*)
362parm_rindex		SR	scroll back #1 lines (P)
363parm_up_cursor		UP	up #1 lines (P*)
364pkey_key		pk	program	function key #1	to type	string #2
365pkey_local		pl	program	function key #1	to execute
366				string #2
367pkey_xmit		px	program	function key #1	to transmit
368				string #2
369print_screen		ps	print contents of screen
370prtr_off		pf	turn off printer
371prtr_on			po	turn on	printer
372repeat_char		rp	repeat char #1 #2 times	(P*)
373reset_1string		r1	reset string
374reset_2string		r2	reset string
375reset_3string		r3	reset string
376reset_file		rf	name of	reset file
377restore_cursor		rc	restore	cursor to last position	of
378				save_cursor
379row_address		cv	vertical position #1 absolute (P)
380save_cursor		sc	save current cursor position (P)
381scroll_forward		sf	scroll text up (P)
382scroll_reverse		sr	scroll text down (P)
383set_attributes		sa	define video attributes	#1-#9 (PG9)
384set_tab			st	set a tab in every row,	current	columns
385set_window		wi	current	window is lines	#1-#2 cols #3-#4
386tab			ta	tab to next 8-space hardware tab stop
387to_status_line		ts	move to	status line
388underline_char		uc	underline char and move	past it
389up_half_line		hu	half a line up
390init_prog		iP	path name of program for initialization
391key_a1			K1	upper left of keypad
392key_a3			K3	upper right of keypad
393key_b2			K2	center of keypad
394key_c1			K4	lower left of keypad
395key_c3			K5	lower right of keypad
396prtr_non		pO	turn on	printer	for #1 bytes
397termcap_init2		i2	secondary initialization string
398termcap_reset		rs	terminal reset string
399#
400# SVr1 capabilities stop here.	IBM's version of terminfo is the same as
401# SVr4 up to this point, but has a different set afterwards.
402#
403char_padding		rP	like insert_padding but	when in	insert mode
404acs_chars		ac	graphics charset pairs - def=vt100
405plab_norm		pn	program	label #1 to show string	#2
406key_btab		kB	back-tab key
407enter_xon_mode		SX	turn on	xon/xoff handshaking
408exit_xon_mode		RX	turn off xon/xoff handshaking
409enter_am_mode		SA	turn on	automatic margins
410exit_am_mode		RA	turn off automatic margins
411xon_character		XN	XON character
412xoff_character		XF	XOFF character
413ena_acs			eA	enable alternate char set
414label_on		LO	turn on	soft labels
415label_off		LF	turn off soft labels
416key_beg			@1	begin key
417key_cancel		@2	cancel key
418key_close		@3	close key
419key_command		@4	command	key
420key_copy		@5	copy key
421key_create		@6	create key
422key_end			@7	end key
423key_enter		@8	enter/send key
424key_exit		@9	exit key
425key_find		@0	find key
426key_help		%1	help key
427key_mark		%2	mark key
428key_message		%3	message	key
429key_move		%4	move key
430key_next		%5	next key
431key_open		%6	open key
432key_options		%7	options	key
433key_previous		%8	previous key
434key_print		%9	print key
435key_redo		%0	redo key
436key_reference		&1	reference key
437key_refresh		&2	refresh	key
438key_replace		&3	replace	key
439key_restart		&4	restart	key
440key_resume		&5	resume key
441key_save		&6	save key
442key_suspend		&7	suspend	key
443key_undo		&8	undo key
444key_sbeg		&9	shifted	key
445key_scancel		&0	shifted	key
446key_scommand		*1	shifted	key
447key_scopy		*2	shifted	key
448key_screate		*3	shifted	key
449key_sdc			*4	shifted	key
450key_sdl			*5	shifted	key
451key_select		*6	select key
452key_send		*7	shifted	key
453key_seol		*8	shifted	key
454key_sexit		*9	shifted	key
455key_sfind		*0	shifted	key
456key_shelp		#1	shifted	key
457key_shome		#2	shifted	key
458key_sic			#3	shifted	key
459key_sleft		#4	shifted	key
460key_smessage		%a	shifted	key
461key_smove		%b	shifted	key
462key_snext		%c	shifted	key
463key_soptions		%d	shifted	key
464key_sprevious		%e	shifted	key
465key_sprint		%f	shifted	key
466key_sredo		%g	shifted	key
467key_sreplace		%h	shifted	key
468key_sright		%i	shifted	key
469key_srsume		%j	shifted	key
470key_ssave		!1	shifted	key
471key_ssuspend		!2	shifted	key
472key_sundo		!3	shifted	key
473req_for_input		RF	send next input	char (for ptys)
474key_f11			F1	F11 function key
475key_f12			F2	F12 function key
476key_f13			F3	F13 function key
477key_f14			F4	F14 function key
478key_f15			F5	F15 function key
479key_f16			F6	F16 function key
480key_f17			F7	F17 function key
481key_f18			F8	F18 function key
482key_f19			F9	F19 function key
483key_f20			FA	F20 function key
484key_f21			FB	F21 function key
485key_f22			FC	F22 function key
486key_f23			FD	F23 function key
487key_f24			FE	F24 function key
488key_f25			FF	F25 function key
489key_f26			FG	F26 function key
490key_f27			FH	F27 function key
491key_f28			FI	F28 function key
492key_f29			FJ	F29 function key
493key_f30			FK	F30 function key
494key_f31			FL	F31 function key
495key_f32			FM	F32 function key
496key_f33			FN	F33 function key
497key_f34			FO	F34 function key
498key_f35			FP	F35 function key
499key_f36			FQ	F36 function key
500key_f37			FR	F37 function key
501key_f38			FS	F38 function key
502key_f39			FT	F39 function key
503key_f40			FU	F40 function key
504key_f41			FV	F41 function key
505key_f42			FW	F42 function key
506key_f43			FX	F43 function key
507key_f44			FY	F44 function key
508key_f45			FZ	F45 function key
509key_f46			Fa	F46 function key
510key_f47			Fb	F47 function key
511key_f48			Fc	F48 function key
512key_f49			Fd	F49 function key
513key_f50			Fe	F50 function key
514key_f51			Ff	F51 function key
515key_f52			Fg	F52 function key
516key_f53			Fh	F53 function key
517key_f54			Fi	F54 function key
518key_f55			Fj	F55 function key
519key_f56			Fk	F56 function key
520key_f57			Fl	F57 function key
521key_f58			Fm	F58 function key
522key_f59			Fn	F59 function key
523key_f60			Fo	F60 function key
524key_f61			Fp	F61 function key
525key_f62			Fq	F62 function key
526key_f63			Fr	F63 function key
527clr_bol			cb	Clear to beginning of line
528clear_margins		MC	clear right and	left soft margins
529set_left_margin		ML	set left soft margin
530set_right_margin	MR	set right soft margin
531label_format		Lf	label format
532set_clock		SC	set clock, #1 hrs #2 mins #3 secs
533display_clock		DK	display	clock at (#1,#2)
534remove_clock		RC	remove clock
535create_window		CW	define a window	#1 from	#2, #3 to #4, #5
536goto_window		WG	go to window #1
537hangup			HU	hang-up	phone
538dial_phone		DI	dial number #1
539quick_dial		QD	dial number #1 without checking
540tone			TO	select touch tone dialing
541pulse			PU	select pulse dialling
542flash_hook		fh	flash switch hook
543fixed_pause		PA	pause for 2-3 seconds
544wait_tone		WA	wait for dial-tone
545user0			u0	User string #0
546user1			u1	User string #1
547user2			u2	User string #2
548user3			u3	User string #3
549user4			u4	User string #4
550user5			u5	User string #5
551user6			u6	User string #6
552user7			u7	User string #7
553user8			u8	User string #8
554user9			u9	User string #9
555#
556# SVr4 added these capabilities to support color
557#
558orig_pair		op	Set default pair to its	original value
559orig_colors		oc	Set all	color pairs to the original ones
560initialize_color	Ic	initialize color #1 to (#2,#3,#4)
561initialize_pair		Ip	Initialize color pair #1 to fg=(#2,#3,#4),
562				bg=(#5,#6,#7)
563set_color_pair		sp	Set current color pair to #1
564set_foreground		Sf	Set foreground color #1
565set_background		Sb	Set background color #1
566#
567# SVr4 added these capabilities to support printers
568#
569change_char_pitch	ZA	Change number of characters per	inch
570change_line_pitch	ZB	Change number of lines per inch
571change_res_horz		ZC	Change horizontal resolution
572change_res_vert		ZD	Change vertical	resolution
573define_char		ZE	Define a character
574enter_doublewide_mode	ZF	Enter double-wide mode
575enter_draft_quality	ZG	Enter draft-quality mode
576enter_italics_mode	ZH	Enter italic mode
577enter_leftward_mode	ZI	Start leftward carriage	motion
578enter_micro_mode	ZJ	Start micro-motion mode
579enter_near_letter_quality	ZK	Enter NLQ mode
580enter_normal_quality	ZL	Enter normal-quality mode
581enter_shadow_mode	ZM	Enter shadow-print mode
582enter_subscript_mode	ZN	Enter subscript	mode
583enter_superscript_mode	ZO	Enter superscript mode
584enter_upward_mode	ZP	Start upward carriage motion
585exit_doublewide_mode	ZQ	End double-wide	mode
586exit_italics_mode	ZR	End italic mode
587exit_leftward_mode	ZS	End left-motion	mode
588exit_micro_mode		ZT	End micro-motion mode
589exit_shadow_mode	ZU	End shadow-print mode
590exit_subscript_mode	ZV	End subscript mode
591exit_superscript_mode	ZW	End superscript	mode
592exit_upward_mode	ZX	End reverse character motion
593micro_column_address	ZY	Like column_address in micro mode
594micro_down		ZZ	Like cursor_down in micro mode
595micro_left		Za	Like cursor_left in micro mode
596micro_right		Zb	Like cursor_right in micro mode
597micro_row_address	Zc	Like row_address in micro mode
598micro_up		Zd	Like cursor_up in micro	mode
599order_of_pins		Ze	Match software bits to print-head pins
600parm_down_micro		Zf	Like parm_down_cursor in micro mode
601parm_left_micro		Zg	Like parm_left_cursor in micro mode
602parm_right_micro	Zh	Like parm_right_cursor in micro	mode
603parm_up_micro		Zi	Like parm_up_cursor in micro mode
604select_char_set		Zj	Select character set
605set_bottom_margin	Zk	Set bottom margin at current line
606set_bottom_margin_parm	Zl	Set bottom margin at line #1 or	#2 lines
607				from bottom
608set_left_margin_parm	Zm	Set left (right) margin	at column #1 (#2)
609set_right_margin_parm	Zn	Set right margin at column #1
610set_top_margin		Zo	Set top	margin at current line
611set_top_margin_parm	Zp	Set top	(bottom) margin	at row #1 (#2)
612start_bit_image		Zq	Start printing bit image graphics
613start_char_set_def	Zr	Start character	set definition
614stop_bit_image		Zs	Stop printing bit image	graphics
615stop_char_set_def	Zt	End definition of character aet
616subscript_characters	Zu	List of	subscriptible characters
617superscript_characters	Zv	List of	superscriptible	characters
618these_cause_cr		Zw	Printing any of	these chars causes CR
619zero_motion		Zx	No motion for subsequent character
620#
621# The following	string capabilities are	present	in the SVr4.0 term
622# structure, but are not documented in the man page.
623#
624char_set_names		Zy	List of	character set names
625key_mouse		Km	Mouse event has	occurred
626mouse_info		Mi	Mouse status information
627req_mouse_pos		RQ	Request	mouse position
628get_mouse		Gm	Curses should get button events
629set_a_foreground	AF	Set ANSI foreground color
630set_a_background	AB	Set ANSI background color
631pkey_plab		xl	Program	function key #1	to type	string #2
632				and show string	#3
633device_type		dv	Indicate language/codeset support
634code_set_init		ci	Init sequence for multiple codesets
635set0_des_seq		s0	Shift to code set 0 (EUC set 0,	ASCII)
636set1_des_seq		s1	Shift to code set 1
637set2_des_seq		s2	Shift to code set 2
638set3_des_seq		s3	Shift to code set 3
639set_lr_margin		ML	Set both left and right	margins	to #1, #2
640set_tb_margin		MT	Sets both top and bottom margins to #1,	#2
641bit_image_repeat	Xy	Repeat bit image cell #1 #2 times
642bit_image_newline	Zz	Move to	next row of the	bit image
643bit_image_carriage_return	Yv	Move to	beginning of same row
644color_names		Yw	Give name for color #1
645define_bit_image_region	Yx	Define rectangular bit image region
646end_bit_image_region	Yy	End a bit-image	region
647set_color_band		Yz	Change to ribbon color #1
648set_page_length		YZ	Set page length	to #1 lines
649#
650# SVr4 added these capabilities for direct PC-clone support
651#
652display_pc_char		S1	Display	PC character
653enter_pc_charset_mode	S2	Enter PC character display mode
654exit_pc_charset_mode	S3	Exit PC	character display mode
655enter_scancode_mode	S4	Enter PC scancode mode
656exit_scancode_mode	S5	Exit PC	scancode mode
657pc_term_options		S6	PC terminal options
658scancode_escape		S7	Escape for scancode emulation
659alt_scancode_esc	S8	Alternate escape for scancode emulation
660#
661# The XSI Curses standard added	these.
662#
663enter_horizontal_hl_mode	Xh	Enter horizontal highlight mode
664enter_left_hl_mode	Xl	Enter left highlight mode
665enter_low_hl_mode	Xo	Enter low highlight mode
666enter_right_hl_mode	Xr	Enter right highlight mode
667enter_top_hl_mode	Xt	Enter top highlight mode
668enter_vertical_hl_mode	Xv	Enter vertical highlight mode
669.Ed
670.Pp
671Obsolete termcap capabilities.
672New software should not rely on them at all.
673.Bd -literal
674\fBBoolean			TCap	Description\fR
675\fBVariables		Code\fR
676linefeed_is_newline	NL	move down with ^J
677even_parity		EP	terminal requires even parity
678odd_parity		OP	terminal requires odd parity
679half_duplex		HD	terminal is half-duplex
680lower_case_only		LC	terminal has only lower	case
681upper_case_only		UC	terminal has only upper	case
682has_hardware_tabs	pt	has 8-char tabs	invoked	with ^I
683return_does_clr_eol	xr	return clears the line
684tek_4025_insert_line	xx	Tektronix 4025 insert-line glitch
685backspaces_with_bs	bs	uses ^H	to move	left
686crt_no_scrolling	ns	crt cannot scroll
687no_correctly_working_cr	nc	no way to go to	start of line
688.Ed
689.Bd -literal
690\fBNumber			TCap	Description\fR
691\fBVariables		Code\fR
692backspace_delay		dB	padding	required for ^H
693form_feed_delay		dF	padding	required for ^L
694horizontal_tab_delay	dT	padding	required for ^I
695vertical_tab_delay	dV	padding	required for ^V
696number_of_function_keys	kn	count of function keys
697carriage_return_delay	dC	pad needed for CR
698new_line_delay		dN	pad needed for LF
699.Ed
700.Bd -literal
701\fBString			TCap	Description\fR
702\fBVariables		Code\fR
703other_non_function_keys	ko	list of	self-mapped keycaps
704arrow_key_map		ma	map arrow keys
705memory_lock_above	ml	lock visible screen memory above the
706				current	line
707memory_unlock		mu	unlock visible screen memory above the
708				current	line
709linefeed_if_not_lf	nl	use to move down
710backspace_if_not_bs	bc	move left, if not ^H
711.Ed
712.Ss A Sample Entry
713The following entry, which describes the Concept\-100, is among the more
714complex entries in the
715.Nm
716file as of this writing.
717.Pp
718.Bd -literal
719ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e
720	:al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e
721	:co#80:.cr=9^M:db:dc=16\eE^A:dl=3*\eE^B:do=^J:ei=\eE\e200:eo:im=\eE^P:in:\e
722	:ip=16*:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:k1=\eE5:\e
723	:k2=\eE6:k3=\eE7:kb=^h:kd=\eE<:ke=\eEx:kh=\eE?:kl=\eE>:kr=\eE=:ks=\eEX:\e
724	:ku=\eE;:le=^H:li#24:mb=\eEC:me=\eEN\e200:mh=\eEE:mi:mk=\eEH:mp=\eEI:\e
725	:mr=\eED:nd=\eE=:pb#9600:rp=0.2*\eEr%.%+ :se=\eEd\eEe:sf=^J:so=\eEE\eED:\e
726	:.ta=8\et:te=\eEv    \e200\e200\e200\e200\e200\e200\eEp\er\en:\e
727	:ti=\eEU\eEv  8p\eEp\er:ue=\eEg:ul:up=\eE;:us=\eEG:\e
728	:vb=\eEk\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\eEK:\e
729	:ve=\eEw:vs=\eEW:vt#8:xn:\e
730	:bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt:
731.Ed
732.Pp
733Entries may continue onto multiple lines by giving a \e as the last
734character of a line, and empty fields
735may be included for readability (here between the last field on a line
736and the first field on the next).
737Comments may be included on lines beginning with
738.Dq # .
739.Ss Types of Capabilities
740Capabilities in
741.Nm
742are of three types: Boolean capabilities,
743which indicate particular features that the terminal has;
744numeric capabilities,
745giving the size of the display or the size of other attributes;
746and string capabilities,
747which give character sequences that can be used to perform particular
748terminal operations.
749All capabilities have two-letter codes.
750For instance, the fact that
751the Concept has
752.Em automatic margins
753(an automatic return and linefeed
754when the end of a line is reached) is indicated by the Boolean capability
755.Sy \&am .
756Hence the description of the Concept includes
757.Sy \&am .
758.Pp
759Numeric capabilities are followed by the character `#' then the value.
760In the example above
761.Sy \&co ,
762which indicates the number of columns the display has,
763gives the value `80' for the Concept.
764.Pp
765Finally, string-valued capabilities, such as
766.Sy \&ce
767(clear-to-end-of-line
768sequence) are given by the two-letter code, an `=', then a string
769ending at the next following `:'.
770A delay in milliseconds may appear after
771the `=' in such a capability,
772which causes padding characters to be supplied by
773.Xr tputs 3
774after the remainder of the string is sent to provide this delay.
775The delay can be either a number,
776such as `20', or a number followed by
777an `*',
778such as `3*'.
779An `*' indicates that the padding required is proportional
780to the number of lines affected by the operation, and the amount given is
781the per-affected-line padding required.
782(In the case of insert-character,
783the factor is still the number of
784.Em lines
785affected;
786this is always 1 unless the terminal has
787.Sy \&in
788and the software uses it.)
789When an `*' is specified, it is sometimes useful to give a delay of the form
790`3.5' to specify a delay per line to tenths of milliseconds.
791(Only one decimal place is allowed.)
792.Pp
793A number of escape sequences are provided in the string-valued capabilities
794for easy encoding of control characters there.
795.Sy \&\eE
796maps to an
797.Dv ESC
798character,
799.Sy \&^X
800maps to a control-X for any appropriate X,
801and the sequences
802.Sy \&\en
803.Sy \&\er
804.Sy \&\et
805.Sy \&\eb
806.Sy \&\ef
807map to linefeed, return, tab, backspace, and formfeed, respectively.
808Finally, characters may be given as three octal digits after a
809.Sy \&\e ,
810and the characters
811.Sy \&^
812and
813.Sy \&\e
814may be given as
815.Sy \&\e^
816and
817.Sy \&\e\e .
818If it is necessary to place a
819.Sy \&:
820in a capability it must be escaped as
821.Sy \e:
822or be encoded as
823.Sy \&\e072 .
824If it is necessary to place a
825.Dv NUL
826character in a string capability it
827must be encoded as
828.Sy \&\e200 .
829(The routines that deal with
830.Nm
831use C strings and strip the high bits of the output very late, so that
832a
833.Sy \&\e200
834comes out as a
835.Sy \&\e000
836would.)
837.Pp
838Sometimes individual capabilities must be commented out.
839To do this, put a period before the capability name.
840For example, see the first
841.Sy \&cr
842and
843.Sy \&ta
844in the example above.
845.Ss Preparing Descriptions
846The most effective way to prepare a terminal description is by imitating
847the description of a similar terminal in
848.Nm
849and to build up a description gradually, using partial descriptions
850with
851.Xr \&vi 1
852to check that they are correct.
853Be aware that a very unusual terminal may expose deficiencies in
854the ability of the
855.Nm
856file to describe it
857or bugs in
858.Xr \&vi 1 .
859To easily test a new terminal description you are working on
860you can put it in your home directory in a file called
861.Pa .termcap
862and programs will look there before looking in
863.Pa /usr/share/misc/termcap .
864You can also set the environment variable
865.Ev TERMPATH
866to a list of absolute file pathnames (separated by spaces or colons),
867one of which contains the description you are working on,
868and programs will search them in the order listed, and nowhere else.
869See
870.Xr termcap 3 .
871The
872.Ev TERMCAP
873environment variable is usually set to the
874.Nm
875entry itself
876to avoid reading files when starting up a program.
877.Pp
878To get the padding for insert-line right
879(if the terminal manufacturer did not document it),
880a severe test is to use
881.Xr \&vi 1
882to edit
883.Pa /etc/passwd
884at 9600 baud, delete roughly 16 lines from the middle of the screen,
885then hit the `u' key several times quickly.
886If the display messes up, more padding is usually needed.
887A similar test can be used for insert-character.
888.Ss Basic Capabilities
889The number of columns on each line of the display is given by the
890.Sy \&co
891numeric capability.
892If the display is a
893.Tn CRT ,
894then the
895number of lines on the screen is given by the
896.Sy \&li
897capability.
898If the display wraps around to the beginning of the next line when
899the cursor reaches the right margin, then it should have the
900.Sy \&am
901capability.
902If the terminal can clear its screen,
903the code to do this is given by the
904.Sy \&cl
905string capability.
906If the terminal overstrikes
907(rather than clearing the position when a character is overwritten),
908it should have the
909.Sy \&os
910capability.
911If the terminal is a printing terminal,
912with no soft copy unit,
913give it both
914.Sy \&hc
915and
916.Sy \&os .
917.Pf ( Sy \&os
918applies to storage scope terminals,
919such as the Tektronix 4010 series,
920as well as to hard copy and
921.Tn APL
922terminals.)
923If there is a code to move the cursor to the left edge of the current row,
924give this as
925.Sy \&cr .
926(Normally this will be carriage-return,
927.Sy \&^M . )
928If there is a code to produce an audible signal (bell, beep,
929etc.),
930give this as
931.Sy \&bl .
932.Pp
933If there is a code (such as backspace)
934to move the cursor one position to the left,
935that capability should be given as
936.Sy \&le .
937Similarly,
938codes to move to the right, up, and down
939should be given as
940.Sy \&nd ,
941.Sy \&up ,
942and
943.Sy \&do ,
944respectively.
945These
946.Em local cursor motions
947should not alter the text they pass over;
948for example, you would not normally use
949.Dq nd=\ \&
950unless the terminal has the
951.Sy \&os
952capability,
953because the space would erase the character moved over.
954.Pp
955A very important point here is that the local cursor motions encoded
956in
957.Nm
958have undefined behavior at the left and top edges of a
959.Tn CRT
960display.
961Programs should never attempt to backspace around the left edge,
962unless
963.Sy \&bw
964is given, and never attempt to go up off the top
965using local cursor motions.
966.Pp
967In order to scroll text up,
968a program goes to the bottom left corner of the screen and sends the
969.Sy \&sf
970(index) string.
971To scroll text down,
972a program goes to the top left corner of the screen and sends the
973.Sy \&sr
974(reverse index) string.
975The strings
976.Sy \&sf
977and
978.Sy \&sr
979have undefined behavior
980when not on their respective corners of the screen.
981Parameterized versions of the scrolling sequences are
982.Sy \&SF
983and
984.Sy \&SR ,
985which have the same semantics as
986.Sy \&sf
987and
988.Sy \&sr
989except that they take one parameter
990and scroll that many lines.
991They also have undefined behavior
992except at the appropriate corner of the screen.
993.Pp
994The
995.Sy \&am
996capability tells whether the cursor sticks at the right
997edge of the screen when text is output there,
998but this does not necessarily apply to
999.Sy \&nd
1000from the last column.
1001Leftward local motion is defined from the left edge only when
1002.Sy \&bw
1003is given; then an
1004.Sy \&le
1005from the left edge will move to the right edge of the previous row.
1006This is useful for drawing a box around the edge of the screen,
1007for example.
1008If the terminal has switch-selectable automatic margins,
1009the
1010.Nm
1011description usually assumes that this feature is on,
1012.Em i.e . ,
1013.Sy \&am .
1014If the terminal has a command
1015that moves to the first column of the next line,
1016that command can be given as
1017.Sy \&nw
1018(newline).
1019It is permissible for this to clear the remainder of the current line,
1020so if the terminal has no correctly-working
1021.Tn \&CR
1022and
1023.Tn \&LF
1024it may still be possible to craft a working
1025.Sy \&nw
1026out of one or both of them.
1027.Pp
1028These capabilities suffice to describe hardcopy and
1029.Dq glass-tty
1030terminals.
1031Thus the Teletype model 33 is described as
1032.Bd -literal -offset indent
1033T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e
1034	:bl=^G:co#72:cr=^M:do=^J:hc:os:
1035.Ed
1036.Pp
1037and the Lear Siegler
1038.Tn ADM Ns \-3
1039is described as
1040.Bd -literal -offset indent
1041l3\||\|adm3\||\|3\||\|LSI \s-1ADM\s0-3:\e
1042:am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J:
1043.Ed
1044.Ss Parameterized Strings
1045Cursor addressing and other strings requiring parameters
1046are described by a
1047parameterized string capability, with
1048.Xr printf 3 Ns \-like
1049escapes
1050.Sy \&%x
1051in it,
1052while other characters are passed through unchanged.
1053For example, to address the cursor the
1054.Sy \&cm
1055capability is given, using two parameters: the row and column to move to.
1056(Rows and columns are numbered from zero and refer to the physical screen
1057visible to the user, not to any unseen memory.
1058If the terminal has memory-relative cursor addressing,
1059that can be indicated by an analogous
1060.Sy \&CM
1061capability.)
1062.Pp
1063The
1064.Sy \&%
1065encodings have the following meanings:
1066.Bl -column xxxxx
1067.It "%%	output `%'"
1068.It "%d	output value as in"
1069.Xr printf 3
1070%d
1071.It "%2	output value as in"
1072.Xr printf 3
1073%2d
1074.It "%3	output value as in"
1075.Xr printf 3
1076%3d
1077.It "%.	output value as in"
1078.Xr printf 3
1079%c
1080.It "%+" Ns Em x Ta No add
1081.Em x
1082to value, then do %.
1083.It "%>" Ns Em \&xy Ta No if
1084value >
1085.Em x
1086then add
1087.Em y ,
1088no output
1089.It "%r	reverse order of two parameters, no output"
1090.It "%i	increment by one, no output"
1091.It "%n	exclusive-or all parameters with 0140 (Datamedia 2500)"
1092.It "\&%B" Ta Tn BCD No "(16*(value/10)) + (value%10), no output"
1093.It "%D	Reverse coding (value \- 2*(value%16)), no output (Delta Data)."
1094.El
1095.Pp
1096Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs
1097to be sent
1098.Dq \eE&a12c03Y
1099padded for 6 milliseconds.
1100Note that the order
1101of the row and column coordinates is reversed here
1102and that the row and column
1103are sent as two-digit integers.
1104Thus its
1105.Sy \&cm
1106capability is
1107.Dq Li cm=6\eE&%r%2c%2Y .
1108.Pp
1109The Datamedia 2500 needs the current row and column sent
1110encoded in binary using
1111.Dq \&%. .
1112Terminals that use
1113.Dq %.\&
1114need to be able to
1115backspace the cursor
1116.Pq Sy \&le
1117and to move the cursor up one line on the screen
1118.Pq Sy \&up .
1119This is necessary because it is not always safe to transmit
1120.Sy \&\en ,
1121.Sy \&^D ,
1122and
1123.Sy \&\er ,
1124as the system may change or discard them.
1125(Programs using
1126.Nm
1127must set terminal modes so that tabs are not expanded, so
1128.Sy \&\et
1129is safe to send.
1130This turns out to be essential for the Ann Arbor 4080.)
1131.Pp
1132A final example is the Lear Siegler
1133.Tn ADM Ns \-3a ,
1134which offsets row and column
1135by a blank character, thus
1136.Dq Li cm=\eE=%+ %+\ \& .
1137.Pp
1138Row or column absolute cursor addressing
1139can be given as single parameter capabilities
1140.Sy \&ch
1141(horizontal position absolute) and
1142.Sy \&cv
1143(vertical position absolute).
1144Sometimes these are shorter than the more general two-parameter sequence
1145(as with the Hewlett-Packard 2645) and can be used in preference to
1146.Sy \&cm .
1147If there are parameterized local motions
1148.Pf ( Em e.g . ,
1149move
1150.Ar n
1151positions to the right)
1152these can be given as
1153.Sy \&DO ,
1154.Sy \&LE ,
1155.Sy \&RI ,
1156and
1157.Sy \&UP
1158with a single parameter indicating how many positions to move.
1159These are primarily useful if the terminal does not have
1160.Sy \&cm ,
1161such as the Tektronix 4025.
1162.Ss Cursor Motions
1163.Pp
1164If the terminal has a fast way to home the cursor
1165(to the very upper left corner of the screen), this can be given as
1166.Sy \&ho .
1167Similarly, a fast way of getting to the lower left-hand corner
1168can be given as
1169.Sy \&ll ;
1170this may involve going up with
1171.Sy \&up
1172from the home position,
1173but a program should never do this itself (unless
1174.Sy \&ll
1175does), because it can
1176make no assumption about the effect of moving up from the home position.
1177Note that the home position is the same as
1178cursor address (0,0): to the top left corner of the screen, not of memory.
1179(Therefore, the
1180.Dq \eEH
1181sequence on Hewlett-Packard terminals
1182cannot be used for
1183.Sy \&ho . )
1184.Ss Area Clears
1185If the terminal can clear from the current position to the end of the
1186line, leaving the cursor where it is, this should be given as
1187.Sy \&ce .
1188If the terminal can clear from the current position to the end of the
1189display, this should be given as
1190.Sy \&cd .
1191.Sy \&cd
1192must only be invoked from the first column of a line.
1193(Therefore,
1194it can be simulated by a request to delete a large number of lines,
1195if a true
1196.Sy \&cd
1197is not available.)
1198.Ss Insert/Delete Line
1199If the terminal can open a new blank line
1200before the line containing the cursor,
1201this should be given as
1202.Sy \&al ;
1203this must be invoked only from the first
1204position of a line.
1205The cursor must then appear at the left of the newly blank line.
1206If the terminal can delete the line that the cursor is on, this
1207should be given as
1208.Sy \&dl ;
1209this must only be used from the first position on
1210the line to be deleted.
1211Versions of
1212.Sy \&al
1213and
1214.Sy \&dl
1215which take a single parameter
1216and insert or delete that many lines
1217can be given as
1218.Sy \&AL
1219and
1220.Sy \&DL .
1221If the terminal has a settable scrolling region
1222(like the VT100),
1223the command to set this can be described with the
1224.Sy \&cs
1225capability,
1226which takes two parameters: the top and bottom lines of the scrolling region.
1227The cursor position is, alas, undefined after using this command.
1228It is possible to get the effect of insert or delete line
1229using this command \(em the
1230.Sy \&sc
1231and
1232.Sy \&rc
1233(save and restore cursor) commands are also useful.
1234Inserting lines at the top or bottom of the screen can also be done using
1235.Sy \&sr
1236or
1237.Sy \&sf
1238on many terminals without a true insert/delete line,
1239and is often faster even on terminals with those features.
1240.Pp
1241If the terminal has the ability to define a window as part of memory
1242which all commands affect, it should be given as the parameterized string
1243.Sy \&wi .
1244The four parameters are the starting and ending lines in memory
1245and the starting and ending columns in memory, in that order.
1246(This
1247.Xr terminfo 5
1248capability is described for completeness.
1249It is unlikely that any
1250.Nm Ns \-using
1251program will support it.)
1252.Pp
1253If the terminal can retain display memory above the screen, then the
1254.Sy \&da
1255capability should be given;
1256if display memory can be retained
1257below, then
1258.Sy \&db
1259should be given.
1260These indicate
1261that deleting a line or scrolling may bring non-blank lines up from below
1262or that scrolling back with
1263.Sy \&sr
1264may bring down non-blank lines.
1265.Ss Insert/Delete Character
1266There are two basic kinds of intelligent terminals with respect to
1267insert/delete character that can be described using
1268.Nm .
1269The most common insert/delete character operations affect only the characters
1270on the current line and shift characters off the end of the line rigidly.
1271Other terminals, such as the Concept\-100 and the Perkin Elmer Owl, make
1272a distinction between typed and untyped blanks on the screen, shifting
1273upon an insert or delete only to an untyped blank on the screen which is
1274either eliminated or expanded to two untyped blanks.
1275You can determine
1276the kind of terminal you have by clearing the screen then typing
1277text separated by cursor motions.
1278Type
1279.Dq Li abc\ \ \ \ def
1280using local
1281cursor motions (not spaces) between the
1282.Dq abc
1283and the
1284.Dq def .
1285Then position the cursor before the
1286.Dq abc
1287and put the terminal in insert
1288mode.
1289If typing characters causes the rest of the line to shift
1290rigidly and characters to fall off the end, then your terminal does
1291not distinguish between blanks and untyped positions.
1292If the
1293.Dq abc
1294shifts over to the
1295.Dq def
1296which then move together around the end of the
1297current line and onto the next as you insert, then you have the second type of
1298terminal and should give the capability
1299.Sy \&in ,
1300which stands for
1301.Dq insert null .
1302While these are two logically separate attributes
1303(one line
1304.Em \&vs .
1305multi-line insert mode,
1306and special treatment of untyped spaces),
1307we have seen no terminals whose insert
1308mode cannot be described with the single attribute.
1309.Pp
1310The
1311.Nm
1312entries can describe both terminals that have an insert mode and terminals
1313that send a simple sequence to open a blank position on the current line.
1314Give as
1315.Sy \&im
1316the sequence to get into insert mode.
1317Give as
1318.Sy \&ei
1319the sequence to leave insert mode.
1320Now give as
1321.Sy \&ic
1322any sequence that needs to be sent just before
1323each character to be inserted.
1324Most terminals with a true insert mode
1325will not give
1326.Sy \&ic ;
1327terminals that use a sequence to open a screen
1328position should give it here.
1329(If your terminal has both,
1330insert mode is usually preferable to
1331.Sy \&ic .
1332Do not give both unless the terminal actually requires both to be used
1333in combination.)
1334If post-insert padding is needed, give this as a number of milliseconds
1335in
1336.Sy \&ip
1337(a string option).
1338Any other sequence that may need to be
1339sent after insertion of a single character can also be given in
1340.Sy \&ip .
1341If your terminal needs to be placed into an `insert mode'
1342and needs a special code preceding each inserted character,
1343then both
1344.Sy \&im Ns / Sy \&ei
1345and
1346.Sy \&ic
1347can be given, and both will be used.
1348The
1349.Sy \&IC
1350capability, with one parameter
1351.Em n ,
1352will repeat the effects of
1353.Sy \&ic
1354.Em n
1355times.
1356.Pp
1357It is occasionally necessary to move around while in insert mode
1358to delete characters on the same line
1359.Pf ( Em e.g . ,
1360if there is a tab after
1361the insertion position).
1362If your terminal allows motion while in
1363insert mode, you can give the capability
1364.Sy \&mi
1365to speed up inserting
1366in this case.
1367Omitting
1368.Sy \&mi
1369will affect only speed.
1370Some terminals
1371(notably Datamedia's) must not have
1372.Sy \&mi
1373because of the way their
1374insert mode works.
1375.Pp
1376Finally, you can specify
1377.Sy \&dc
1378to delete a single character,
1379.Sy \&DC
1380with one parameter
1381.Em n
1382to delete
1383.Em n
1384characters,
1385and delete mode by giving
1386.Sy \&dm
1387and
1388.Sy \&ed
1389to enter and exit delete mode
1390(which is any mode the terminal needs to be placed in for
1391.Sy \&dc
1392to work).
1393.Ss Highlighting, Underlining, and Visible Bells
1394If your terminal has one or more kinds of display attributes,
1395these can be represented in a number of different ways.
1396You should choose one display form as
1397.Em standout mode ,
1398representing a good high-contrast, easy-on-the-eyes format
1399for highlighting error messages and other attention getters.
1400(If you have a choice, reverse video plus half-bright is good,
1401or reverse video alone.)
1402The sequences to enter and exit standout mode
1403are given as
1404.Sy \&so
1405and
1406.Sy \&se ,
1407respectively.
1408If the code to change into or out of standout
1409mode leaves one or even two blank spaces or garbage characters on the screen,
1410as the
1411.Tn TVI
1412912 and Teleray 1061 do,
1413then
1414.Sy \&sg
1415should be given to tell how many characters are left.
1416.Pp
1417Codes to begin underlining and end underlining can be given as
1418.Sy \&us
1419and
1420.Sy \&ue ,
1421respectively.
1422Underline mode change garbage is specified by
1423.Sy \&ug ,
1424similar to
1425.Sy \&sg .
1426If the terminal has a code to underline the current character and move
1427the cursor one position to the right,
1428such as the Microterm Mime,
1429this can be given as
1430.Sy \&uc .
1431.Pp
1432Other capabilities to enter various highlighting modes include
1433.Sy \&mb
1434(blinking),
1435.Sy \&md
1436(bold or extra bright),
1437.Sy \&mh
1438(dim or half-bright),
1439.Sy \&mk
1440(blanking or invisible text),
1441.Sy \&mp
1442(protected),
1443.Sy \&mr
1444(reverse video),
1445.Sy \&me
1446(turn off
1447.Em all
1448attribute modes),
1449.Sy \&as
1450(enter alternate character set mode), and
1451.Sy \&ae
1452(exit alternate character set mode).
1453Turning on any of these modes singly may or may not turn off other modes.
1454.Pp
1455If there is a sequence to set arbitrary combinations of mode,
1456this should be given as
1457.Sy \&sa
1458(set attributes), taking 9 parameters.
1459Each parameter is either 0 or 1,
1460as the corresponding attributes is on or off.
1461The 9 parameters are, in order: standout, underline, reverse, blink,
1462dim, bold, blank, protect, and alternate character set.
1463Not all modes need be supported by
1464.Sy \&sa ,
1465only those for which corresponding attribute commands exist.
1466(It is unlikely that a
1467.Nm Ns \-using
1468program will support this capability, which is defined for compatibility
1469with
1470.Xr terminfo 5 . )
1471.Pp
1472Terminals with the
1473.Dq magic cookie
1474glitches
1475.Pf ( Sy \&sg
1476and
1477.Sy \&ug ) ,
1478rather than maintaining extra attribute bits for each character cell,
1479instead deposit special
1480.Dq cookies ,
1481or
1482.Dq garbage characters ,
1483when they receive mode-setting sequences,
1484which affect the display algorithm.
1485.Pp
1486Some terminals,
1487such as the Hewlett-Packard 2621,
1488automatically leave standout
1489mode when they move to a new line or when the cursor is addressed.
1490Programs using standout mode
1491should exit standout mode on such terminals
1492before moving the cursor or sending a newline.
1493On terminals where this is not a problem,
1494the
1495.Sy \&ms
1496capability should be present
1497to say that this overhead is unnecessary.
1498.Pp
1499If the terminal has
1500a way of flashing the screen to indicate an error quietly
1501(a bell replacement),
1502this can be given as
1503.Sy \&vb ;
1504it must not move the cursor.
1505.Pp
1506If the cursor needs to be made more visible than normal
1507when it is not on the bottom line
1508(to change, for example, a non-blinking underline into an easier-to-find
1509block or blinking underline),
1510give this sequence as
1511.Sy \&vs .
1512If there is a way to make the cursor completely invisible, give that as
1513.Sy \&vi .
1514The capability
1515.Sy \&ve ,
1516which undoes the effects of both of these modes,
1517should also be given.
1518.Pp
1519If your terminal correctly displays underlined characters
1520(with no special codes needed)
1521even though it does not overstrike,
1522then you should give the capability
1523.Sy \&ul .
1524If overstrikes are erasable with a blank,
1525this should be indicated by giving
1526.Sy \&eo .
1527.Ss Keypad
1528If the terminal has a keypad that transmits codes when the keys are pressed,
1529this information can be given.
1530Note that it is not possible to handle
1531terminals where the keypad only works in local mode
1532(this applies, for example, to the unshifted Hewlett-Packard 2621 keys).
1533If the keypad can be set to transmit or not transmit,
1534give these codes as
1535.Sy \&ks
1536and
1537.Sy \&ke .
1538Otherwise the keypad is assumed to always transmit.
1539The codes sent by the left-arrow, right-arrow, up-arrow, down-arrow,
1540and home keys can be given as
1541.Sy \&kl ,
1542.Sy \&kr ,
1543.Sy \&ku ,
1544.Sy \&kd ,
1545and
1546.Sy \&kh ,
1547respectively.
1548If there are function keys such as f0, f1, ..., f9, the codes they send
1549can be given as
1550.Sy \&k0 ,
1551.Sy \&k1 ,
1552\&...,
1553.Sy \&k9 .
1554If these keys have labels other than the default f0 through f9, the labels
1555can be given as
1556.Sy \&l0 ,
1557.Sy \&l1 ,
1558\&...,
1559.Sy \&l9 .
1560The codes transmitted by certain other special keys can be given:
1561.Sy \&kH
1562(home down),
1563.Sy \&kb
1564(backspace),
1565.Sy \&ka
1566(clear all tabs),
1567.Sy \&kt
1568(clear the tab stop in this column),
1569.Sy \&kC
1570(clear screen or erase),
1571.Sy \&kD
1572(delete character),
1573.Sy \&kL
1574(delete line),
1575.Sy \&kM
1576(exit insert mode),
1577.Sy \&kE
1578(clear to end of line),
1579.Sy \&kS
1580(clear to end of screen),
1581.Sy \&kI
1582(insert character or enter insert mode),
1583.Sy \&kA
1584(insert line),
1585.Sy \&kN
1586(next page),
1587.Sy \&kP
1588(previous page),
1589.Sy \&kF
1590(scroll forward/down),
1591.Sy \&kR
1592(scroll backward/up), and
1593.Sy \&kT
1594(set a tab stop in this column).
1595In addition, if the keypad has a 3 by 3 array of keys
1596including the four arrow keys, then the other five keys can be given as
1597.Sy \&K1 ,
1598.Sy \&K2 ,
1599.Sy \&K3 ,
1600.Sy \&K4 ,
1601and
1602.Sy \&K5 .
1603These keys are useful when the effects of a 3 by 3 directional pad are needed.
1604The obsolete
1605.Sy \&ko
1606capability formerly used to describe
1607.Dq other
1608function keys has been
1609completely supplanted by the above capabilities.
1610.Pp
1611The
1612.Sy \&ma
1613entry is also used to indicate arrow keys on terminals that have
1614single-character arrow keys.
1615It is obsolete but still in use in
1616version 2 of
1617.Sy \&vi
1618which must be run on some minicomputers due to
1619memory limitations.
1620This field is redundant with
1621.Sy \&kl ,
1622.Sy \&kr ,
1623.Sy \&ku ,
1624.Sy \&kd ,
1625and
1626.Sy \&kh .
1627It consists of groups of two characters.
1628In each group, the first character is what an arrow key sends, and the
1629second character is the corresponding
1630.Sy \&vi
1631command.
1632These commands are
1633.Ar h
1634for
1635.Sy \&kl ,
1636.Ar j
1637for
1638.Sy \&kd ,
1639.Ar k
1640for
1641.Sy \&ku ,
1642.Ar l
1643for
1644.Sy \&kr ,
1645and
1646.Ar H
1647for
1648.Sy \&kh .
1649For example, the Mime would have
1650.Dq Li ma=^Hh^Kj^Zk^Xl
1651indicating arrow keys left (^H), down (^K), up (^Z), and right (^X).
1652(There is no home key on the Mime.)
1653.Ss Tabs and Initialization
1654If the terminal needs to be in a special mode when running
1655a program that uses these capabilities,
1656the codes to enter and exit this mode can be given as
1657.Sy \&ti
1658and
1659.Sy \&te .
1660This arises, for example, from terminals like the Concept with more than
1661one page of memory.
1662If the terminal has only memory-relative cursor addressing and not
1663screen-relative cursor addressing,
1664a screen-sized window must be fixed into
1665the display for cursor addressing to work properly.
1666This is also used for the Tektronix 4025, where
1667.Sy \&ti
1668sets the command character to be the one used by
1669.Nm .
1670.Pp
1671Other capabilities
1672include
1673.Sy \&is ,
1674an initialization string for the terminal,
1675and
1676.Sy \&if ,
1677the name of a file containing long initialization strings.
1678These strings are expected to set the terminal into modes
1679consistent with the rest of the
1680.Nm
1681description.
1682They are normally sent to the terminal by the
1683.Xr tset 1
1684program each time the user logs in.
1685They will be printed in the following order:
1686.Sy \&is ;
1687setting tabs using
1688.Sy \&ct
1689and
1690.Sy \&st ;
1691and finally
1692.Sy \&if .
1693.Pf ( Xr Terminfo
1694uses
1695.Sy \&i\&1-i2
1696instead of
1697.Sy \&is
1698and runs the program
1699.Sy \&iP
1700and prints
1701.Sy "\&i\&3"
1702after the other initializations.)
1703A pair of sequences that does a harder reset from a totally unknown state
1704can be analogously given as
1705.Sy \&rs
1706and
1707.Sy \&if .
1708These strings are output by the
1709.Xr reset 1
1710program, which is used when the terminal gets into a wedged state.
1711.Pf ( Xr Terminfo
1712uses
1713.Sy "\&r1-r3"
1714instead of
1715.Sy \&rs . )
1716Commands are normally placed in
1717.Sy \&rs
1718and
1719.Sy \&rf
1720only if they produce annoying effects on the screen and are not necessary
1721when logging in.
1722For example, the command to set the VT100 into 80-column mode
1723would normally be part of
1724.Sy \&is ,
1725but it causes an annoying glitch of the screen and is not normally needed
1726since the terminal is usually already in 80-column mode.
1727.Pp
1728If the terminal has hardware tabs,
1729the command to advance to the next tab stop can be given as
1730.Sy \&ta
1731(usually
1732.Sy \&^I ) .
1733A
1734.Dq backtab
1735command which moves leftward to the previous tab stop
1736can be given as
1737.Sy \&bt .
1738By convention,
1739if the terminal driver modes indicate that tab stops are being expanded
1740by the computer rather than being sent to the terminal,
1741programs should not use
1742.Sy \&ta
1743or
1744.Sy \&bt
1745even if they are present,
1746since the user may not have the tab stops properly set.
1747If the terminal has hardware tabs that are initially set every
1748.Ar n
1749positions when the terminal is powered up, then the numeric parameter
1750.Sy \&it
1751is given, showing the number of positions between tab stops.
1752This is normally used by the
1753.Xr tset 1
1754command to determine whether to set the driver mode for hardware tab
1755expansion, and whether to set the tab stops.
1756If the terminal has tab stops that can be saved in nonvolatile memory, the
1757.Nm
1758description can assume that they are properly set.
1759.Pp
1760If there are commands to set and clear tab stops, they can be given as
1761.Sy \&ct
1762(clear all tab stops) and
1763.Sy \&st
1764(set a tab stop in the current column of every row).
1765If a more complex sequence is needed to set the tabs than can be
1766described by this, the sequence can be placed in
1767.Sy \&is
1768or
1769.Sy \&if .
1770.Ss Delays
1771Certain capabilities control padding in the terminal driver.
1772These are primarily needed by hardcopy terminals and are used by the
1773.Xr tset 1
1774program to set terminal driver modes appropriately.
1775Delays embedded in the capabilities
1776.Sy \&cr ,
1777.Sy \&sf ,
1778.Sy \&le ,
1779.Sy \&ff ,
1780and
1781.Sy \&ta
1782will cause the appropriate delay bits to be set in the terminal driver.
1783If
1784.Sy \&pb
1785(padding baud rate) is given, these values can be ignored at baud rates
1786below the value of
1787.Sy \&pb .
1788For
1789.Bx 4.2
1790.Xr tset 1 ,
1791the delays are given as numeric capabilities
1792.Sy \&dC ,
1793.Sy \&dN ,
1794.Sy \&dB ,
1795.Sy \&dF ,
1796and
1797.Sy \&dT
1798instead.
1799.Ss Miscellaneous
1800If the terminal requires other than a
1801.Dv NUL
1802(zero) character as a pad,
1803this can be given as
1804.Sy \&pc .
1805Only the first character of the
1806.Sy \&pc
1807string is used.
1808.Pp
1809If the terminal has commands to save and restore the position of the
1810cursor, give them as
1811.Sy \&sc
1812and
1813.Sy \&rc .
1814.Pp
1815If the terminal has an extra
1816.Dq status line
1817that is not normally used by
1818software, this fact can be indicated.
1819If the status line is viewed as an extra line below the bottom line,
1820then the capability
1821.Sy \&hs
1822should be given.
1823Special strings to go to a position in the status line and to return
1824from the status line can be given as
1825.Sy \&ts
1826and
1827.Sy \&fs .
1828.Pf ( Xr \&fs
1829must leave the cursor position in the same place that it was before
1830.Sy \&ts .
1831If necessary, the
1832.Sy \&sc
1833and
1834.Sy \&rc
1835strings can be included in
1836.Sy \&ts
1837and
1838.Sy \&fs
1839to get this effect.)
1840The capability
1841.Sy \&ts
1842takes one parameter, which is the column number of the status line
1843to which the cursor is to be moved.
1844If escape sequences and other special commands such as tab work while in
1845the status line, the flag
1846.Sy \&es
1847can be given.
1848A string that turns off the status line (or otherwise erases its contents)
1849should be given as
1850.Sy \&ds .
1851The status line is normally assumed to be the same width as the
1852rest of the screen,
1853.Em i.e . ,
1854.Sy \&co .
1855If the status line is a different width (possibly because the terminal
1856does not allow an entire line to be loaded), then its width in columns
1857can be indicated with the numeric parameter
1858.Sy \&ws .
1859.Pp
1860If the terminal can move up or down half a line, this can be
1861indicated with
1862.Sy \&hu
1863(half-line up) and
1864.Sy \&hd
1865(half-line down).
1866This is primarily useful for superscripts and subscripts on hardcopy
1867terminals.
1868If a hardcopy terminal can eject to the next page (form feed),
1869give this as
1870.Sy \&ff
1871(usually
1872.Sy \&^L ) .
1873.Pp
1874If there is a command to repeat a given character a given number of times
1875(to save time transmitting a large number of identical characters),
1876this can be indicated with the parameterized string
1877.Sy \&rp .
1878The first parameter is the character to be repeated and the second is
1879the number of times to repeat it.
1880(This is a
1881.Xr terminfo 5
1882feature that is unlikely to be supported by a program that uses
1883.Nm . )
1884.Pp
1885If the terminal has a settable command character, such as the
1886Tektronix 4025, this can be indicated with
1887.Sy \&CC .
1888A prototype command character is chosen which is used in all capabilities.
1889This character is given in the
1890.Sy \&CC
1891capability to identify it.
1892The following convention is supported on some
1893.Ux
1894systems:
1895The environment is to be searched for a
1896.Ev \&CC
1897variable,
1898and if found,
1899all occurrences of the prototype character are replaced by the character
1900in the environment variable.
1901This use of the
1902.Ev \&CC
1903environment variable
1904is a very bad idea, as it conflicts with
1905.Xr make 1 .
1906.Pp
1907Terminal descriptions that do not represent a specific kind of known
1908terminal, such as
1909.Em switch ,
1910.Em dialup ,
1911.Em patch ,
1912and
1913.Em network ,
1914should include the
1915.Sy \&gn
1916(generic) capability so that programs can complain that they do not know
1917how to talk to the terminal.
1918(This capability does not apply to
1919.Em virtual
1920terminal descriptions for which the escape sequences are known.)
1921.Pp
1922If the terminal uses xoff/xon
1923.Pq Tn DC3 Ns / Ns Tn DC1
1924handshaking for flow control, give
1925.Sy \&xo .
1926Padding information should still be included so that routines can make
1927better decisions about costs, but actual pad characters will not be
1928transmitted.
1929.Pp
1930If the terminal has a
1931.Dq meta key
1932which acts as a shift key, setting the
19338th bit of any character transmitted, then this fact can be indicated with
1934.Sy \&km .
1935Otherwise, software will assume that the 8th bit is parity and it will
1936usually be cleared.
1937If strings exist to turn this
1938.Dq meta mode
1939on and off, they can be given as
1940.Sy \&mm
1941and
1942.Sy \&mo .
1943.Pp
1944If the terminal has more lines of memory than will fit on the screen at once,
1945the number of lines of memory can be indicated with
1946.Sy \&lm .
1947An explicit value of 0 indicates that the number of lines is not fixed,
1948but that there is still more memory than fits on the screen.
1949.Pp
1950If the terminal is one of those supported by the
1951.Ux
1952system virtual
1953terminal protocol, the terminal number can be given as
1954.Sy \&vt .
1955.Pp
1956Media copy strings which control an auxiliary printer
1957connected to the terminal can be given as
1958.Sy \&ps :
1959print the contents of the screen;
1960.Sy \&pf :
1961turn off the printer; and
1962.Sy \&po :
1963turn on the printer.
1964When the printer is on, all text sent to the terminal will be sent to the
1965printer.
1966It is undefined whether the text is also displayed on the terminal screen
1967when the printer is on.
1968A variation
1969.Sy \&pO
1970takes one parameter and leaves the printer on for as many characters as the
1971value of the parameter, then turns the printer off.
1972The parameter should not exceed 255.
1973All text, including
1974.Sy \&pf ,
1975is transparently passed to the printer while
1976.Sy \&pO
1977is in effect.
1978.Pp
1979Strings to program function keys can be given as
1980.Sy \&pk ,
1981.Sy \&pl ,
1982and
1983.Sy \&px .
1984Each of these strings takes two parameters: the function key number
1985to program (from 0 to 9) and the string to program it with.
1986Function key numbers out of this range may program undefined keys
1987in a terminal-dependent manner.
1988The differences among the capabilities are that
1989.Sy \&pk
1990causes pressing the given key to be the same as the user typing the given
1991string;
1992.Sy \&pl
1993causes the string to be executed by the terminal in local mode;
1994and
1995.Sy \&px
1996causes the string to be transmitted to the computer.
1997Unfortunately, due to lack of a definition for string parameters in
1998.Nm ,
1999only
2000.Xr terminfo 5
2001supports these capabilities.
2002.Ss Glitches and Braindamage
2003Hazeltine terminals, which do not allow `~' characters to be displayed,
2004should indicate
2005.Sy \&hz .
2006.Pp
2007The
2008.Sy \&nc
2009capability, now obsolete, formerly indicated Datamedia terminals,
2010which echo
2011.Sy \&\er \en
2012for
2013carriage return then ignore a following linefeed.
2014.Pp
2015Terminals that ignore a linefeed immediately after an
2016.Sy \&am
2017wrap, such as the Concept, should indicate
2018.Sy \&xn .
2019.Pp
2020If
2021.Sy \&ce
2022is required to get rid of standout
2023(instead of merely writing normal text on top of it),
2024.Sy \&xs
2025should be given.
2026.Pp
2027Teleray terminals, where tabs turn all characters moved over to blanks,
2028should indicate
2029.Sy \&xt
2030(destructive tabs).
2031This glitch is also taken to mean that it is not possible
2032to position the cursor on top of a
2033.Dq magic cookie ,
2034and that
2035to erase standout mode it is necessary to use delete and insert line.
2036.Pp
2037The Beehive Superbee, which is unable to correctly transmit the
2038.Dv ESC
2039or
2040.Sy \&^C
2041characters, has
2042.Sy \&xb ,
2043indicating that the
2044.Dq \&f\&1
2045key is used for
2046.Dv ESC
2047and
2048.Dq \&f\&2
2049for ^C.
2050(Only certain Superbees have this problem, depending on the
2051.Tn ROM . )
2052.Pp
2053Other specific terminal problems may be corrected by adding more
2054capabilities of the form
2055.Sy x Em x .
2056.Ss Similar Terminals
2057If there are two very similar terminals,
2058one can be defined as being just like the other with certain exceptions.
2059The string capability
2060.Sy \&tc
2061can be given
2062with the name of the similar terminal.
2063This capability must be
2064.Em last ,
2065and the combined length of the entries
2066must not exceed 1024.
2067The capabilities given before
2068.Sy \&tc
2069override those in the terminal type invoked by
2070.Sy \&tc .
2071A capability can be canceled by placing
2072.Sy \&xx@
2073to the left of the
2074.Sy \&tc
2075invocation, where
2076.Sy \&xx
2077is the capability.
2078For example, the entry
2079.Bd -literal -offset indent
2080hn\||\|2621\-nl:ks@:ke@:tc=2621:
2081.Ed
2082.Pp
2083defines a
2084.Dq 2621\-nl
2085that does not have the
2086.Sy \&ks
2087or
2088.Sy \&ke
2089capabilities,
2090hence does not turn on the function key labels when in visual mode.
2091This is useful for different modes for a terminal, or for different
2092user preferences.
2093.Sh FILES
2094.Bl -tag -width /usr/share/misc/termcap.db -compact
2095.It Pa /usr/share/misc/termcap
2096File containing terminal descriptions.
2097.It Pa /usr/share/misc/termcap.db
2098Hash database file containing terminal descriptions (see
2099.Xr cap_mkdb 1 ) .
2100.El
2101.Sh SEE ALSO
2102.Xr cap_mkdb 1 ,
2103.Xr ex 1 ,
2104.Xr more 1 ,
2105.Xr tset 1 ,
2106.Xr ul 1 ,
2107.Xr vi 1 ,
2108.Xr ncurses 3 ,
2109.Xr printf 3 ,
2110.Xr termcap 3 ,
2111.Xr term 5
2112.Sh CAVEATS AND BUGS
2113The
2114.Em Note :
2115.Nm
2116functions
2117were replaced by
2118.Xr terminfo 5
2119in
2120.At V
2121Release 2.0.
2122The transition will be relatively painless if capabilities flagged as
2123.Dq obsolete
2124are avoided.
2125.Pp
2126Lines and columns are now stored by the kernel as well as in the termcap
2127entry.
2128Most programs now use the kernel information primarily; the information
2129in this file is used only if the kernel does not have any information.
2130.Pp
2131The
2132.Xr \&vi 1
2133program allows only 256 characters for string capabilities, and the routines
2134in
2135.Xr termlib 3
2136do not check for overflow of this buffer.
2137The total length of a single entry (excluding only escaped newlines)
2138may not exceed 1024.
2139.Pp
2140Not all programs support all entries.
2141.Sh HISTORY
2142The
2143.Nm
2144file format appeared in
2145.Bx 3 .
2146