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