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