blob: 1c34010f05198b87b42288dada377b8918a90cd9 [file] [log] [blame]
LuK133752a81d52025-07-08 18:07:20 -04001'\" t
2.\" DO NOT EDIT THIS FILE BY HAND!
3.\" It is generated from terminfo.head, ./../include/Caps ./../include/Caps-ncurses, and terminfo.tail.
4.\"
5.\" Note: this must be run through tbl before nroff.
6.\" The magic cookie on the first line triggers this under some man programs.
7.\"***************************************************************************
8.\" Copyright 2018-2023,2024 Thomas E. Dickey *
9.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
10.\" *
11.\" Permission is hereby granted, free of charge, to any person obtaining a *
12.\" copy of this software and associated documentation files (the *
13.\" "Software"), to deal in the Software without restriction, including *
14.\" without limitation the rights to use, copy, modify, merge, publish, *
15.\" distribute, distribute with modifications, sublicense, and/or sell *
16.\" copies of the Software, and to permit persons to whom the Software is *
17.\" furnished to do so, subject to the following conditions: *
18.\" *
19.\" The above copyright notice and this permission notice shall be included *
20.\" in all copies or substantial portions of the Software. *
21.\" *
22.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
23.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
24.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
25.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
26.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
27.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
28.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
29.\" *
30.\" Except as contained in this notice, the name(s) of the above copyright *
31.\" holders shall not be used in advertising or otherwise to promote the *
32.\" sale, use or other dealings in this Software without prior written *
33.\" authorization. *
34.\"***************************************************************************
35.\"
36.\" $Id: terminfo.head,v 1.65 2024/04/20 21:14:00 tom Exp $
37.TH terminfo 5 2024-04-20 "ncurses @NCURSES_MAJOR@.@NCURSES_MINOR@" "File formats"
38.ie \n(.g \{\
39.ds `` \(lq
40.ds '' \(rq
41.ds ' \(aq
42.ds ^ \(ha
43.ds ~ \(ti
44.\}
45.el \{\
46.ie t .ds `` ``
47.el .ds `` ""
48.ie t .ds '' ''
49.el .ds '' ""
50.ds ' '
51.ds ^ ^
52.ds ~ ~
53.\}
54.
55.de bP
56.ie n .IP \(bu 4
57.el .IP \(bu 2
58..
59.
60.ds d @TERMINFO@
61.SH NAME
62\fB\%terminfo\fP \-
63terminal capability database
64.SH SYNOPSIS
65\*d/*/*
66.SH DESCRIPTION
67.I Terminfo
68is a database describing terminals,
69used by screen-oriented programs such as
70\fBnvi\fP(1),
71\fBlynx\fP(1),
72\fBmutt\fP(1),
73and other curses applications,
74using high-level calls to libraries such as \fBcurses\fP(3X).
75It is also used via low-level calls by non-curses applications
76which may be screen-oriented (such as \fB@CLEAR@\fP(1))
77or non-screen (such as \fB@TABS@\fP(1)).
78.PP
79.I Terminfo
80describes terminals by giving a set of capabilities which they
81have, by specifying how to perform screen operations, and by
82specifying padding requirements and initialization sequences.
83.PP
84This document describes
85.I \%ncurses
86version @NCURSES_MAJOR@.@NCURSES_MINOR@
87(patch @NCURSES_PATCH@).
88.SS "\fIterminfo\fP Entry Syntax"
89Entries in
90.I terminfo
91consist of a sequence of fields:
92.bP
93Each field ends with a comma \*(``,\*(''
94(embedded commas may be
95escaped with a backslash or written as \*(``\e054\*('').
96.bP
97White space between fields is ignored.
98.bP
99The first field in a \fIterminfo\fP entry begins in the first column.
100.bP
101Newlines and leading whitespace (spaces or tabs)
102may be used for formatting entries for readability.
103These are removed from parsed entries.
104.IP
105The \fB@INFOCMP@\fP \fB\-f\fP and \fB\-W\fP options rely on this to
106format if-then-else expressions,
107or to enforce maximum line-width.
108The resulting formatted terminal description can be read by \fB@TIC@\fP.
109.bP
110The first field for each terminal gives the names which are known for the
111terminal, separated by \*(``|\*('' characters.
112.IP
113The first name given is the most common abbreviation for the terminal
114(its primary name),
115the last name given should be a long name fully identifying the terminal
116(see \fBlongname\fP(3X)),
117and all others are treated as synonyms (aliases) for the primary terminal name.
118.IP
119X/Open Curses advises that all names but the last should be in lower case
120and contain no blanks;
121the last name may well contain upper case and blanks for readability.
122.IP
123This implementation is not so strict;
124it allows mixed case in the primary name and aliases.
125If the last name has no embedded blanks,
126it allows that to be both an alias and a verbose name
127(but will warn about this ambiguity).
128.bP
129Lines beginning with a \*(``#\*('' in the first column are treated as comments.
130.IP
131While comment lines are valid at any point, the output of \fB@CAPTOINFO@\fP
132and \fB@INFOTOCAP@\fP (aliases for \fB@TIC@\fP)
133will move comments so they occur only between entries.
134.PP
135Terminal names (except for the last, verbose entry) should
136be chosen using the following conventions.
137The particular piece of hardware making up the terminal should
138have a root name, thus \*(``hp2621\*(''.
139This name should not contain hyphens.
140Modes that the hardware can be in, or user preferences, should
141be indicated by appending a hyphen and a mode suffix.
142Thus, a vt100 in 132-column mode would be vt100\-w.
143The following suffixes should be used where possible:
144.PP
145.TS
146center;
147Lb Lb Lb
148L L Lx.
149Suffix Example Meaning
150_
151\-\fInn\fP aaa\-60 Number of lines on the screen
152\-\fIn\fPp c100\-4p Number of pages of memory
153\-am vt100\-am With automargins (usually the default)
154\-m ansi\-m Mono mode; suppress color
155\-mc wy30\-mc Magic cookie; spaces when highlighting
156\-na c100\-na No arrow keys (leave them in local)
157\-nam vt100\-nam Without automatic margins
158\-nl hp2621\-nl No status line
159\-ns hp2626\-ns No status line
160\-rv c100\-rv Reverse video
161\-s vt100\-s Enable status line
162\-vb wy370\-vb Use visible bell instead of beep
163\-w vt100\-w Wide mode (> 80 columns, usually 132)
164.TE
165.PP
166For more on terminal naming conventions, see the \fBterm\fP(7) manual page.
167.SS "\fIterminfo\fP Capabilities Syntax"
168The terminfo entry consists of several \fIcapabilities\fP,
169i.e., features that the terminal has,
170or methods for exercising the terminal's features.
171.PP
172After the first field (giving the name(s) of the terminal entry),
173there should be one or more \fIcapability\fP fields.
174These are Boolean, numeric or string names with corresponding values:
175.bP
176Boolean capabilities are true when present, false when absent.
177There is no explicit value for Boolean capabilities.
178.bP
179Numeric capabilities have a \*(``#\*('' following the name,
180then an unsigned decimal integer value.
181.bP
182String capabilities have a \*(``=\*('' following the name,
183then an string of characters making up the capability value.
184.IP
185String capabilities can be split into multiple lines,
186just as the fields comprising a terminal entry can be
187split into multiple lines.
188While blanks between fields are ignored,
189blanks embedded within a string value are retained,
190except for leading blanks on a line.
191.PP
192Any capability can be \fIcanceled\fP,
193i.e., suppressed from the terminal entry,
194by following its name with \*(``@\*(''
195rather than a capability value.
196.SS "Similar Terminals"
197If there are two very similar terminals, one (the variant) can be defined as
198being just like the other (the base) with certain exceptions.
199In the
200definition of the variant, the string capability \fBuse\fP can be given with
201the name of the base terminal:
202.bP
203The capabilities given before
204.B use
205override those in the base type named by
206.BR use .
207.bP
208If there are multiple \fBuse\fP capabilities, they are merged in reverse order.
209That is, the rightmost \fBuse\fP reference is processed first, then the one to
210its left, and so forth.
211.bP
212Capabilities given explicitly in the entry override
213those brought in by \fBuse\fP references.
214.PP
215A capability can be canceled by placing \fBxx@\fP to the left of the
216use reference that imports it, where \fIxx\fP is the capability.
217For example, the entry
218.RS
219.PP
2202621\-nl, smkx@, rmkx@, use=2621,
221.RE
222.PP
223defines a 2621\-nl that does not have the \fBsmkx\fP or \fBrmkx\fP capabilities,
224and hence does not turn on the function key labels when in visual mode.
225This is useful for different modes for a terminal, or for different
226user preferences.
227.PP
228An entry included via \fBuse\fP can contain canceled capabilities,
229which have the same effect as if those cancels were inline in the
230using terminal entry.
231.SS "Predefined Capabilities"
232.\" Head of terminfo man page ends here
233.ps -1
234Tables of capabilities
235.I \%ncurses
236recognizes in a
237.I \%term\%info
238terminal type description and available to
239.IR \%term\%info -using
240code follow.
241.bP
242The capability name identifies the symbol by which the programmer
243using the
244.I \%term\%info
245API accesses the capability.
246.bP
247The TI
248.RI ( \%term\%info )
249code is the short name used by a person composing or updating a
250terminal type entry.
251.IP
252Whenever possible,
253these codes are the same as or similar to those of the ANSI X3.64-1979
254standard
255(now superseded by ECMA-48,
256which uses identical or very similar names).
257Semantics are also intended to match those of the specification.
258.IP
259.I \%term\%info
260codes have no hard length limit,
261but
262.I \%ncurses
263maintains an informal one of 5 characters to keep them short and to
264allow the tabs in the source file
265.I Caps
266to line up nicely.
267(Some standard codes exceed this limit regardless.)
268.bP
269The TC
270.RI ( termcap )
271code is that used by the corresponding API of
272.IR \%ncurses .
273(Some capabilities are new,
274and have names that BSD
275.I termcap
276did not originate.)
277.bP
278The description field attempts to convey the capability's semantics.
279.PP
280The description field employs a handful of notations.
281.TP
282.B (P)
283indicates that padding may be specified.
284.TP
285.B (P*)
286indicates that padding may vary in proportion to the number of output
287lines affected.
288.TP
289.BI # i
290indicates the
291.IR i th
292parameter of a string capability;
293the programmer should pass the string to \fB\%tparm\fP(3X) with the
294parameters listed.
295.IP
296If the description lists no parameters,
297passing the string to \fB\%tparm\fP(3X) may produce unexpected
298behavior,
299for instance if the string contains percent signs.
300.
301.PP
302.TS
303center;
304Lb Cb S Lb
305Lb Lb Lb Lb
306Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
307\& Code \&
308Boolean Capability Name TI TC Description
309_
310auto_left_margin bw bw T{
311.ad l
312cub1 wraps from column 0 to last column
313T}
314auto_right_margin am am T{
315.ad l
316terminal has automatic margins
317T}
318no_esc_ctlc xsb xb T{
319.ad l
320beehive (f1=escape, f2=ctrl C)
321T}
322ceol_standout_glitch xhp xs T{
323.ad l
324standout not erased by overwriting (hp)
325T}
326eat_newline_glitch xenl xn T{
327.ad l
328newline ignored after 80 cols (concept)
329T}
330erase_overstrike eo eo T{
331.ad l
332can erase overstrikes with a blank
333T}
334generic_type gn gn T{
335.ad l
336generic line type
337T}
338hard_copy hc hc T{
339.ad l
340hardcopy terminal
341T}
342has_meta_key km km T{
343.ad l
344Has a meta key (i.e., sets 8th-bit)
345T}
346has_status_line hs hs T{
347.ad l
348has extra status line
349T}
350insert_null_glitch in in T{
351.ad l
352insert mode distinguishes nulls
353T}
354memory_above da da T{
355.ad l
356display may be retained above the screen
357T}
358memory_below db db T{
359.ad l
360display may be retained below the screen
361T}
362move_insert_mode mir mi T{
363.ad l
364safe to move while in insert mode
365T}
366move_standout_mode msgr ms T{
367.ad l
368safe to move while in standout mode
369T}
370over_strike os os T{
371.ad l
372terminal can overstrike
373T}
374status_line_esc_ok eslok es T{
375.ad l
376escape can be used on the status line
377T}
378dest_tabs_magic_smso xt xt T{
379.ad l
380tabs destructive, magic so char (t1061)
381T}
382tilde_glitch hz hz T{
383.ad l
384cannot print ~'s (Hazeltine)
385T}
386transparent_underline ul ul T{
387.ad l
388underline character overstrikes
389T}
390xon_xoff xon xo T{
391.ad l
392terminal uses xon/xoff handshaking
393T}
394needs_xon_xoff nxon nx T{
395.ad l
396padding will not work, xon/xoff required
397T}
398prtr_silent mc5i 5i T{
399.ad l
400printer will not echo on screen
401T}
402hard_cursor chts HC T{
403.ad l
404cursor is hard to see
405T}
406non_rev_rmcup nrrmc NR T{
407.ad l
408smcup does not reverse rmcup
409T}
410no_pad_char npc NP T{
411.ad l
412pad character does not exist
413T}
414non_dest_scroll_region ndscr ND T{
415.ad l
416scrolling region is non-destructive
417T}
418can_change ccc cc T{
419.ad l
420terminal can re-define existing colors
421T}
422back_color_erase bce ut T{
423.ad l
424screen erased with background color
425T}
426hue_lightness_saturation hls hl T{
427.ad l
428terminal uses only HLS color notation (Tektronix)
429T}
430col_addr_glitch xhpa YA T{
431.ad l
432only positive motion for hpa/mhpa caps
433T}
434cr_cancels_micro_mode crxm YB T{
435.ad l
436using cr turns off micro mode
437T}
438has_print_wheel daisy YC T{
439.ad l
440printer needs operator to change character set
441T}
442row_addr_glitch xvpa YD T{
443.ad l
444only positive motion for vpa/mvpa caps
445T}
446semi_auto_right_margin sam YE T{
447.ad l
448printing in last column causes cr
449T}
450cpi_changes_res cpix YF T{
451.ad l
452changing character pitch changes resolution
453T}
454lpi_changes_res lpix YG T{
455.ad l
456changing line pitch changes resolution
457T}
458.TE
459.PP
460.
461.TS
462center;
463Lb Cb S Lb
464Lb Lb Lb Lb
465Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
466\& Code \&
467Numeric Capability Name TI TC Description
468_
469columns cols co T{
470.ad l
471number of columns in a line
472T}
473init_tabs it it T{
474.ad l
475tabs initially every # spaces
476T}
477lines lines li T{
478.ad l
479number of lines on screen or page
480T}
481lines_of_memory lm lm T{
482.ad l
483lines of memory if > line. 0 means varies
484T}
485magic_cookie_glitch xmc sg T{
486.ad l
487number of blank characters left by smso or rmso
488T}
489padding_baud_rate pb pb T{
490.ad l
491lowest baud rate where padding needed
492T}
493virtual_terminal vt vt T{
494.ad l
495virtual terminal number (CB/unix)
496T}
497width_status_line wsl ws T{
498.ad l
499number of columns in status line
500T}
501num_labels nlab Nl T{
502.ad l
503number of labels on screen
504T}
505label_height lh lh T{
506.ad l
507rows in each label
508T}
509label_width lw lw T{
510.ad l
511columns in each label
512T}
513max_attributes ma ma T{
514.ad l
515maximum combined attributes terminal can handle
516T}
517maximum_windows wnum MW T{
518.ad l
519maximum number of definable windows
520T}
521max_colors colors Co T{
522.ad l
523maximum number of colors on screen
524T}
525max_pairs pairs pa T{
526.ad l
527maximum number of color-pairs on the screen
528T}
529no_color_video ncv NC T{
530.ad l
531video attributes that cannot be used with colors
532T}
533.TE
534.PP
535.
536The following numeric capabilities are present in the SVr4.0 term structure,
537but are not yet documented in the man page.
538They came in with SVr4's printer support.
539.
540.PP
541.TS
542center;
543Lb Cb S Lb
544Lb Lb Lb Lb
545Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
546\& Code \&
547Numeric Capability Name TI TC Description
548_
549buffer_capacity bufsz Ya T{
550.ad l
551numbers of bytes buffered before printing
552T}
553dot_vert_spacing spinv Yb T{
554.ad l
555spacing of pins vertically in pins per inch
556T}
557dot_horz_spacing spinh Yc T{
558.ad l
559spacing of dots horizontally in dots per inch
560T}
561max_micro_address maddr Yd T{
562.ad l
563maximum value in micro_..._address
564T}
565max_micro_jump mjump Ye T{
566.ad l
567maximum value in parm_..._micro
568T}
569micro_col_size mcs Yf T{
570.ad l
571character step size when in micro mode
572T}
573micro_line_size mls Yg T{
574.ad l
575line step size when in micro mode
576T}
577number_of_pins npins Yh T{
578.ad l
579numbers of pins in print-head
580T}
581output_res_char orc Yi T{
582.ad l
583horizontal resolution in units per line
584T}
585output_res_line orl Yj T{
586.ad l
587vertical resolution in units per line
588T}
589output_res_horz_inch orhi Yk T{
590.ad l
591horizontal resolution in units per inch
592T}
593output_res_vert_inch orvi Yl T{
594.ad l
595vertical resolution in units per inch
596T}
597print_rate cps Ym T{
598.ad l
599print rate in characters per second
600T}
601wide_char_size widcs Yn T{
602.ad l
603character step size when in double wide mode
604T}
605buttons btns BT T{
606.ad l
607number of buttons on mouse
608T}
609bit_image_entwining bitwin Yo T{
610.ad l
611number of passes for each bit-image row
612T}
613bit_image_type bitype Yp T{
614.ad l
615type of bit-image device
616T}
617.TE
618.PP
619.
620.TS
621center;
622Lb Cb S Lb
623Lb Lb Lb Lb
624Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
625\& Code \&
626String Capability Name TI TC Description
627_
628back_tab cbt bt T{
629.ad l
630back tab (P)
631T}
632bell bel bl T{
633.ad l
634audible signal (bell) (P)
635T}
636carriage_return cr cr T{
637.ad l
638carriage return (P*) (P*)
639T}
640change_scroll_region csr cs T{
641.ad l
642change region to line #1 to line #2 (P)
643T}
644clear_all_tabs tbc ct T{
645.ad l
646clear all tab stops (P)
647T}
648clear_screen clear cl T{
649.ad l
650clear screen and home cursor (P*)
651T}
652clr_eol el ce T{
653.ad l
654clear to end of line (P)
655T}
656clr_eos ed cd T{
657.ad l
658clear to end of screen (P*)
659T}
660column_address hpa ch T{
661.ad l
662horizontal position #1, absolute (P)
663T}
664command_character cmdch CC T{
665.ad l
666terminal settable cmd character in prototype !?
667T}
668cursor_address cup cm T{
669.ad l
670move to row #1 columns #2
671T}
672cursor_down cud1 do T{
673.ad l
674down one line
675T}
676cursor_home home ho T{
677.ad l
678home cursor (if no cup)
679T}
680cursor_invisible civis vi T{
681.ad l
682make cursor invisible
683T}
684cursor_left cub1 le T{
685.ad l
686move left one space
687T}
688cursor_mem_address mrcup CM T{
689.ad l
690memory relative cursor addressing, move to row #1 columns #2
691T}
692cursor_normal cnorm ve T{
693.ad l
694make cursor appear normal (undo civis/cvvis)
695T}
696cursor_right cuf1 nd T{
697.ad l
698non-destructive space (move right one space)
699T}
700cursor_to_ll ll ll T{
701.ad l
702last line, first column (if no cup)
703T}
704cursor_up cuu1 up T{
705.ad l
706up one line
707T}
708cursor_visible cvvis vs T{
709.ad l
710make cursor very visible
711T}
712delete_character dch1 dc T{
713.ad l
714delete character (P*)
715T}
716delete_line dl1 dl T{
717.ad l
718delete line (P*)
719T}
720dis_status_line dsl ds T{
721.ad l
722disable status line
723T}
724down_half_line hd hd T{
725.ad l
726half a line down
727T}
728enter_alt_charset_mode smacs as T{
729.ad l
730start alternate character set (P)
731T}
732enter_blink_mode blink mb T{
733.ad l
734turn on blinking
735T}
736enter_bold_mode bold md T{
737.ad l
738turn on bold (extra bright) mode
739T}
740enter_ca_mode smcup ti T{
741.ad l
742string to start programs using cup
743T}
744enter_delete_mode smdc dm T{
745.ad l
746enter delete mode
747T}
748enter_dim_mode dim mh T{
749.ad l
750turn on half-bright mode
751T}
752enter_insert_mode smir im T{
753.ad l
754enter insert mode
755T}
756enter_secure_mode invis mk T{
757.ad l
758turn on blank mode (characters invisible)
759T}
760enter_protected_mode prot mp T{
761.ad l
762turn on protected mode
763T}
764enter_reverse_mode rev mr T{
765.ad l
766turn on reverse video mode
767T}
768enter_standout_mode smso so T{
769.ad l
770begin standout mode
771T}
772enter_underline_mode smul us T{
773.ad l
774begin underline mode
775T}
776erase_chars ech ec T{
777.ad l
778erase #1 characters (P)
779T}
780exit_alt_charset_mode rmacs ae T{
781.ad l
782end alternate character set (P)
783T}
784exit_attribute_mode sgr0 me T{
785.ad l
786turn off all attributes
787T}
788exit_ca_mode rmcup te T{
789.ad l
790strings to end programs using cup
791T}
792exit_delete_mode rmdc ed T{
793.ad l
794end delete mode
795T}
796exit_insert_mode rmir ei T{
797.ad l
798exit insert mode
799T}
800exit_standout_mode rmso se T{
801.ad l
802exit standout mode
803T}
804exit_underline_mode rmul ue T{
805.ad l
806exit underline mode
807T}
808flash_screen flash vb T{
809.ad l
810visible bell (may not move cursor)
811T}
812form_feed ff ff T{
813.ad l
814hardcopy terminal page eject (P*)
815T}
816from_status_line fsl fs T{
817.ad l
818return from status line
819T}
820init_1string is1 i1 T{
821.ad l
822initialization string
823T}
824init_2string is2 is T{
825.ad l
826initialization string
827T}
828init_3string is3 i3 T{
829.ad l
830initialization string
831T}
832init_file if if T{
833.ad l
834name of initialization file
835T}
836insert_character ich1 ic T{
837.ad l
838insert character (P)
839T}
840insert_line il1 al T{
841.ad l
842insert line (P*)
843T}
844insert_padding ip ip T{
845.ad l
846insert padding after inserted character
847T}
848key_backspace kbs kb T{
849.ad l
850backspace key
851T}
852key_catab ktbc ka T{
853.ad l
854clear-all-tabs key
855T}
856key_clear kclr kC T{
857.ad l
858clear-screen or erase key
859T}
860key_ctab kctab kt T{
861.ad l
862clear-tab key
863T}
864key_dc kdch1 kD T{
865.ad l
866delete-character key
867T}
868key_dl kdl1 kL T{
869.ad l
870delete-line key
871T}
872key_down kcud1 kd T{
873.ad l
874down-arrow key
875T}
876.TE
877.TS
878center;
879Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
880key_eic krmir kM T{
881.ad l
882sent by rmir or smir in insert mode
883T}
884key_eol kel kE T{
885.ad l
886clear-to-end-of-line key
887T}
888key_eos ked kS T{
889.ad l
890clear-to-end-of-screen key
891T}
892key_f0 kf0 k0 T{
893.ad l
894F0 function key
895T}
896key_f1 kf1 k1 T{
897.ad l
898F1 function key
899T}
900key_f10 kf10 k; T{
901.ad l
902F10 function key
903T}
904key_f2 kf2 k2 T{
905.ad l
906F2 function key
907T}
908key_f3 kf3 k3 T{
909.ad l
910F3 function key
911T}
912key_f4 kf4 k4 T{
913.ad l
914F4 function key
915T}
916key_f5 kf5 k5 T{
917.ad l
918F5 function key
919T}
920key_f6 kf6 k6 T{
921.ad l
922F6 function key
923T}
924key_f7 kf7 k7 T{
925.ad l
926F7 function key
927T}
928key_f8 kf8 k8 T{
929.ad l
930F8 function key
931T}
932key_f9 kf9 k9 T{
933.ad l
934F9 function key
935T}
936key_home khome kh T{
937.ad l
938home key
939T}
940key_ic kich1 kI T{
941.ad l
942insert-character key
943T}
944key_il kil1 kA T{
945.ad l
946insert-line key
947T}
948key_left kcub1 kl T{
949.ad l
950left-arrow key
951T}
952key_ll kll kH T{
953.ad l
954lower-left key (home down)
955T}
956key_npage knp kN T{
957.ad l
958next-page key
959T}
960key_ppage kpp kP T{
961.ad l
962previous-page key
963T}
964key_right kcuf1 kr T{
965.ad l
966right-arrow key
967T}
968key_sf kind kF T{
969.ad l
970scroll-forward key
971T}
972key_sr kri kR T{
973.ad l
974scroll-backward key
975T}
976key_stab khts kT T{
977.ad l
978set-tab key
979T}
980key_up kcuu1 ku T{
981.ad l
982up-arrow key
983T}
984keypad_local rmkx ke T{
985.ad l
986leave keyboard transmit mode
987T}
988keypad_xmit smkx ks T{
989.ad l
990enter keyboard transmit mode
991T}
992lab_f0 lf0 l0 T{
993.ad l
994label on function key f0 if not f0
995T}
996lab_f1 lf1 l1 T{
997.ad l
998label on function key f1 if not f1
999T}
1000lab_f10 lf10 la T{
1001.ad l
1002label on function key f10 if not f10
1003T}
1004lab_f2 lf2 l2 T{
1005.ad l
1006label on function key f2 if not f2
1007T}
1008lab_f3 lf3 l3 T{
1009.ad l
1010label on function key f3 if not f3
1011T}
1012lab_f4 lf4 l4 T{
1013.ad l
1014label on function key f4 if not f4
1015T}
1016lab_f5 lf5 l5 T{
1017.ad l
1018label on function key f5 if not f5
1019T}
1020lab_f6 lf6 l6 T{
1021.ad l
1022label on function key f6 if not f6
1023T}
1024lab_f7 lf7 l7 T{
1025.ad l
1026label on function key f7 if not f7
1027T}
1028lab_f8 lf8 l8 T{
1029.ad l
1030label on function key f8 if not f8
1031T}
1032lab_f9 lf9 l9 T{
1033.ad l
1034label on function key f9 if not f9
1035T}
1036meta_off rmm mo T{
1037.ad l
1038turn off meta mode
1039T}
1040meta_on smm mm T{
1041.ad l
1042turn on meta mode (8th-bit on)
1043T}
1044newline nel nw T{
1045.ad l
1046newline (behave like cr followed by lf)
1047T}
1048pad_char pad pc T{
1049.ad l
1050padding char (instead of null)
1051T}
1052parm_dch dch DC T{
1053.ad l
1054delete #1 characters (P*)
1055T}
1056parm_delete_line dl DL T{
1057.ad l
1058delete #1 lines (P*)
1059T}
1060parm_down_cursor cud DO T{
1061.ad l
1062down #1 lines (P*)
1063T}
1064parm_ich ich IC T{
1065.ad l
1066insert #1 characters (P*)
1067T}
1068parm_index indn SF T{
1069.ad l
1070scroll forward #1 lines (P)
1071T}
1072parm_insert_line il AL T{
1073.ad l
1074insert #1 lines (P*)
1075T}
1076parm_left_cursor cub LE T{
1077.ad l
1078move #1 characters to the left (P)
1079T}
1080parm_right_cursor cuf RI T{
1081.ad l
1082move #1 characters to the right (P*)
1083T}
1084parm_rindex rin SR T{
1085.ad l
1086scroll back #1 lines (P)
1087T}
1088parm_up_cursor cuu UP T{
1089.ad l
1090up #1 lines (P*)
1091T}
1092pkey_key pfkey pk T{
1093.ad l
1094program function key #1 to type string #2
1095T}
1096pkey_local pfloc pl T{
1097.ad l
1098program function key #1 to execute string #2
1099T}
1100pkey_xmit pfx px T{
1101.ad l
1102program function key #1 to transmit string #2
1103T}
1104print_screen mc0 ps T{
1105.ad l
1106print contents of screen
1107T}
1108prtr_off mc4 pf T{
1109.ad l
1110turn off printer
1111T}
1112prtr_on mc5 po T{
1113.ad l
1114turn on printer
1115T}
1116repeat_char rep rp T{
1117.ad l
1118repeat char #1 #2 times (P*)
1119T}
1120reset_1string rs1 r1 T{
1121.ad l
1122reset string
1123T}
1124reset_2string rs2 r2 T{
1125.ad l
1126reset string
1127T}
1128.TE
1129.TS
1130center;
1131Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
1132reset_3string rs3 r3 T{
1133.ad l
1134reset string
1135T}
1136reset_file rf rf T{
1137.ad l
1138name of reset file
1139T}
1140restore_cursor rc rc T{
1141.ad l
1142restore cursor to position of last save_cursor
1143T}
1144row_address vpa cv T{
1145.ad l
1146vertical position #1 absolute (P)
1147T}
1148save_cursor sc sc T{
1149.ad l
1150save current cursor position (P)
1151T}
1152scroll_forward ind sf T{
1153.ad l
1154scroll text up (P)
1155T}
1156scroll_reverse ri sr T{
1157.ad l
1158scroll text down (P)
1159T}
1160set_attributes sgr sa T{
1161.ad l
1162define video attributes #1-#9 (PG9)
1163T}
1164set_tab hts st T{
1165.ad l
1166set a tab in every row, current columns
1167T}
1168set_window wind wi T{
1169.ad l
1170current window is lines #1-#2 cols #3-#4
1171T}
1172tab ht ta T{
1173.ad l
1174tab to next 8-space hardware tab stop
1175T}
1176to_status_line tsl ts T{
1177.ad l
1178move to status line, column #1
1179T}
1180underline_char uc uc T{
1181.ad l
1182underline char and move past it
1183T}
1184up_half_line hu hu T{
1185.ad l
1186half a line up
1187T}
1188init_prog iprog iP T{
1189.ad l
1190path name of program for initialization
1191T}
1192key_a1 ka1 K1 T{
1193.ad l
1194upper left of keypad
1195T}
1196key_a3 ka3 K3 T{
1197.ad l
1198upper right of keypad
1199T}
1200key_b2 kb2 K2 T{
1201.ad l
1202center of keypad
1203T}
1204key_c1 kc1 K4 T{
1205.ad l
1206lower left of keypad
1207T}
1208key_c3 kc3 K5 T{
1209.ad l
1210lower right of keypad
1211T}
1212prtr_non mc5p pO T{
1213.ad l
1214turn on printer for #1 bytes
1215T}
1216char_padding rmp rP T{
1217.ad l
1218like ip but when in insert mode
1219T}
1220acs_chars acsc ac T{
1221.ad l
1222graphics charset pairs, based on vt100
1223T}
1224plab_norm pln pn T{
1225.ad l
1226program label #1 to show string #2
1227T}
1228key_btab kcbt kB T{
1229.ad l
1230back-tab key
1231T}
1232enter_xon_mode smxon SX T{
1233.ad l
1234turn on xon/xoff handshaking
1235T}
1236exit_xon_mode rmxon RX T{
1237.ad l
1238turn off xon/xoff handshaking
1239T}
1240enter_am_mode smam SA T{
1241.ad l
1242turn on automatic margins
1243T}
1244exit_am_mode rmam RA T{
1245.ad l
1246turn off automatic margins
1247T}
1248xon_character xonc XN T{
1249.ad l
1250XON character
1251T}
1252xoff_character xoffc XF T{
1253.ad l
1254XOFF character
1255T}
1256ena_acs enacs eA T{
1257.ad l
1258enable alternate char set
1259T}
1260label_on smln LO T{
1261.ad l
1262turn on soft labels
1263T}
1264label_off rmln LF T{
1265.ad l
1266turn off soft labels
1267T}
1268key_beg kbeg @1 T{
1269.ad l
1270begin key
1271T}
1272key_cancel kcan @2 T{
1273.ad l
1274cancel key
1275T}
1276key_close kclo @3 T{
1277.ad l
1278close key
1279T}
1280key_command kcmd @4 T{
1281.ad l
1282command key
1283T}
1284key_copy kcpy @5 T{
1285.ad l
1286copy key
1287T}
1288key_create kcrt @6 T{
1289.ad l
1290create key
1291T}
1292key_end kend @7 T{
1293.ad l
1294end key
1295T}
1296key_enter kent @8 T{
1297.ad l
1298enter/send key
1299T}
1300key_exit kext @9 T{
1301.ad l
1302exit key
1303T}
1304key_find kfnd @0 T{
1305.ad l
1306find key
1307T}
1308key_help khlp %1 T{
1309.ad l
1310help key
1311T}
1312key_mark kmrk %2 T{
1313.ad l
1314mark key
1315T}
1316key_message kmsg %3 T{
1317.ad l
1318message key
1319T}
1320key_move kmov %4 T{
1321.ad l
1322move key
1323T}
1324key_next knxt %5 T{
1325.ad l
1326next key
1327T}
1328key_open kopn %6 T{
1329.ad l
1330open key
1331T}
1332key_options kopt %7 T{
1333.ad l
1334options key
1335T}
1336key_previous kprv %8 T{
1337.ad l
1338previous key
1339T}
1340key_print kprt %9 T{
1341.ad l
1342print key
1343T}
1344key_redo krdo %0 T{
1345.ad l
1346redo key
1347T}
1348key_reference kref &1 T{
1349.ad l
1350reference key
1351T}
1352key_refresh krfr &2 T{
1353.ad l
1354refresh key
1355T}
1356key_replace krpl &3 T{
1357.ad l
1358replace key
1359T}
1360key_restart krst &4 T{
1361.ad l
1362restart key
1363T}
1364key_resume kres &5 T{
1365.ad l
1366resume key
1367T}
1368key_save ksav &6 T{
1369.ad l
1370save key
1371T}
1372key_suspend kspd &7 T{
1373.ad l
1374suspend key
1375T}
1376key_undo kund &8 T{
1377.ad l
1378undo key
1379T}
1380.TE
1381.TS
1382center;
1383Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
1384key_sbeg kBEG &9 T{
1385.ad l
1386shifted begin key
1387T}
1388key_scancel kCAN &0 T{
1389.ad l
1390shifted cancel key
1391T}
1392key_scommand kCMD *1 T{
1393.ad l
1394shifted command key
1395T}
1396key_scopy kCPY *2 T{
1397.ad l
1398shifted copy key
1399T}
1400key_screate kCRT *3 T{
1401.ad l
1402shifted create key
1403T}
1404key_sdc kDC *4 T{
1405.ad l
1406shifted delete-character key
1407T}
1408key_sdl kDL *5 T{
1409.ad l
1410shifted delete-line key
1411T}
1412key_select kslt *6 T{
1413.ad l
1414select key
1415T}
1416key_send kEND *7 T{
1417.ad l
1418shifted end key
1419T}
1420key_seol kEOL *8 T{
1421.ad l
1422shifted clear-to-end-of-line key
1423T}
1424key_sexit kEXT *9 T{
1425.ad l
1426shifted exit key
1427T}
1428key_sfind kFND *0 T{
1429.ad l
1430shifted find key
1431T}
1432key_shelp kHLP #1 T{
1433.ad l
1434shifted help key
1435T}
1436key_shome kHOM #2 T{
1437.ad l
1438shifted home key
1439T}
1440key_sic kIC #3 T{
1441.ad l
1442shifted insert-character key
1443T}
1444key_sleft kLFT #4 T{
1445.ad l
1446shifted left-arrow key
1447T}
1448key_smessage kMSG %a T{
1449.ad l
1450shifted message key
1451T}
1452key_smove kMOV %b T{
1453.ad l
1454shifted move key
1455T}
1456key_snext kNXT %c T{
1457.ad l
1458shifted next key
1459T}
1460key_soptions kOPT %d T{
1461.ad l
1462shifted options key
1463T}
1464key_sprevious kPRV %e T{
1465.ad l
1466shifted previous key
1467T}
1468key_sprint kPRT %f T{
1469.ad l
1470shifted print key
1471T}
1472key_sredo kRDO %g T{
1473.ad l
1474shifted redo key
1475T}
1476key_sreplace kRPL %h T{
1477.ad l
1478shifted replace key
1479T}
1480key_sright kRIT %i T{
1481.ad l
1482shifted right-arrow key
1483T}
1484key_srsume kRES %j T{
1485.ad l
1486shifted resume key
1487T}
1488key_ssave kSAV !1 T{
1489.ad l
1490shifted save key
1491T}
1492key_ssuspend kSPD !2 T{
1493.ad l
1494shifted suspend key
1495T}
1496key_sundo kUND !3 T{
1497.ad l
1498shifted undo key
1499T}
1500req_for_input rfi RF T{
1501.ad l
1502send next input char (for ptys)
1503T}
1504key_f11 kf11 F1 T{
1505.ad l
1506F11 function key
1507T}
1508key_f12 kf12 F2 T{
1509.ad l
1510F12 function key
1511T}
1512key_f13 kf13 F3 T{
1513.ad l
1514F13 function key
1515T}
1516key_f14 kf14 F4 T{
1517.ad l
1518F14 function key
1519T}
1520key_f15 kf15 F5 T{
1521.ad l
1522F15 function key
1523T}
1524key_f16 kf16 F6 T{
1525.ad l
1526F16 function key
1527T}
1528key_f17 kf17 F7 T{
1529.ad l
1530F17 function key
1531T}
1532key_f18 kf18 F8 T{
1533.ad l
1534F18 function key
1535T}
1536key_f19 kf19 F9 T{
1537.ad l
1538F19 function key
1539T}
1540key_f20 kf20 FA T{
1541.ad l
1542F20 function key
1543T}
1544key_f21 kf21 FB T{
1545.ad l
1546F21 function key
1547T}
1548key_f22 kf22 FC T{
1549.ad l
1550F22 function key
1551T}
1552key_f23 kf23 FD T{
1553.ad l
1554F23 function key
1555T}
1556key_f24 kf24 FE T{
1557.ad l
1558F24 function key
1559T}
1560key_f25 kf25 FF T{
1561.ad l
1562F25 function key
1563T}
1564key_f26 kf26 FG T{
1565.ad l
1566F26 function key
1567T}
1568key_f27 kf27 FH T{
1569.ad l
1570F27 function key
1571T}
1572key_f28 kf28 FI T{
1573.ad l
1574F28 function key
1575T}
1576key_f29 kf29 FJ T{
1577.ad l
1578F29 function key
1579T}
1580key_f30 kf30 FK T{
1581.ad l
1582F30 function key
1583T}
1584key_f31 kf31 FL T{
1585.ad l
1586F31 function key
1587T}
1588key_f32 kf32 FM T{
1589.ad l
1590F32 function key
1591T}
1592key_f33 kf33 FN T{
1593.ad l
1594F33 function key
1595T}
1596key_f34 kf34 FO T{
1597.ad l
1598F34 function key
1599T}
1600key_f35 kf35 FP T{
1601.ad l
1602F35 function key
1603T}
1604key_f36 kf36 FQ T{
1605.ad l
1606F36 function key
1607T}
1608key_f37 kf37 FR T{
1609.ad l
1610F37 function key
1611T}
1612key_f38 kf38 FS T{
1613.ad l
1614F38 function key
1615T}
1616key_f39 kf39 FT T{
1617.ad l
1618F39 function key
1619T}
1620key_f40 kf40 FU T{
1621.ad l
1622F40 function key
1623T}
1624key_f41 kf41 FV T{
1625.ad l
1626F41 function key
1627T}
1628key_f42 kf42 FW T{
1629.ad l
1630F42 function key
1631T}
1632.TE
1633.TS
1634center;
1635Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
1636key_f43 kf43 FX T{
1637.ad l
1638F43 function key
1639T}
1640key_f44 kf44 FY T{
1641.ad l
1642F44 function key
1643T}
1644key_f45 kf45 FZ T{
1645.ad l
1646F45 function key
1647T}
1648key_f46 kf46 Fa T{
1649.ad l
1650F46 function key
1651T}
1652key_f47 kf47 Fb T{
1653.ad l
1654F47 function key
1655T}
1656key_f48 kf48 Fc T{
1657.ad l
1658F48 function key
1659T}
1660key_f49 kf49 Fd T{
1661.ad l
1662F49 function key
1663T}
1664key_f50 kf50 Fe T{
1665.ad l
1666F50 function key
1667T}
1668key_f51 kf51 Ff T{
1669.ad l
1670F51 function key
1671T}
1672key_f52 kf52 Fg T{
1673.ad l
1674F52 function key
1675T}
1676key_f53 kf53 Fh T{
1677.ad l
1678F53 function key
1679T}
1680key_f54 kf54 Fi T{
1681.ad l
1682F54 function key
1683T}
1684key_f55 kf55 Fj T{
1685.ad l
1686F55 function key
1687T}
1688key_f56 kf56 Fk T{
1689.ad l
1690F56 function key
1691T}
1692key_f57 kf57 Fl T{
1693.ad l
1694F57 function key
1695T}
1696key_f58 kf58 Fm T{
1697.ad l
1698F58 function key
1699T}
1700key_f59 kf59 Fn T{
1701.ad l
1702F59 function key
1703T}
1704key_f60 kf60 Fo T{
1705.ad l
1706F60 function key
1707T}
1708key_f61 kf61 Fp T{
1709.ad l
1710F61 function key
1711T}
1712key_f62 kf62 Fq T{
1713.ad l
1714F62 function key
1715T}
1716key_f63 kf63 Fr T{
1717.ad l
1718F63 function key
1719T}
1720clr_bol el1 cb T{
1721.ad l
1722Clear to beginning of line
1723T}
1724clear_margins mgc MC T{
1725.ad l
1726clear right and left soft margins
1727T}
1728set_left_margin smgl ML T{
1729.ad l
1730set left soft margin at current column (not in BSD \fItermcap\fP)
1731T}
1732set_right_margin smgr MR T{
1733.ad l
1734set right soft margin at current column
1735T}
1736label_format fln Lf T{
1737.ad l
1738label format
1739T}
1740set_clock sclk SC T{
1741.ad l
1742set clock, #1 hrs #2 mins #3 secs
1743T}
1744display_clock dclk DK T{
1745.ad l
1746display clock
1747T}
1748remove_clock rmclk RC T{
1749.ad l
1750remove clock
1751T}
1752create_window cwin CW T{
1753.ad l
1754define a window #1 from #2,#3 to #4,#5
1755T}
1756goto_window wingo WG T{
1757.ad l
1758go to window #1
1759T}
1760hangup hup HU T{
1761.ad l
1762hang-up phone
1763T}
1764dial_phone dial DI T{
1765.ad l
1766dial number #1
1767T}
1768quick_dial qdial QD T{
1769.ad l
1770dial number #1 without checking
1771T}
1772tone tone TO T{
1773.ad l
1774select touch tone dialing
1775T}
1776pulse pulse PU T{
1777.ad l
1778select pulse dialing
1779T}
1780flash_hook hook fh T{
1781.ad l
1782flash switch hook
1783T}
1784fixed_pause pause PA T{
1785.ad l
1786pause for 2-3 seconds
1787T}
1788wait_tone wait WA T{
1789.ad l
1790wait for dial-tone
1791T}
1792user0 u0 u0 T{
1793.ad l
1794User string #0
1795T}
1796user1 u1 u1 T{
1797.ad l
1798User string #1
1799T}
1800user2 u2 u2 T{
1801.ad l
1802User string #2
1803T}
1804user3 u3 u3 T{
1805.ad l
1806User string #3
1807T}
1808user4 u4 u4 T{
1809.ad l
1810User string #4
1811T}
1812user5 u5 u5 T{
1813.ad l
1814User string #5
1815T}
1816user6 u6 u6 T{
1817.ad l
1818User string #6
1819T}
1820user7 u7 u7 T{
1821.ad l
1822User string #7
1823T}
1824user8 u8 u8 T{
1825.ad l
1826User string #8
1827T}
1828user9 u9 u9 T{
1829.ad l
1830User string #9
1831T}
1832orig_pair op op T{
1833.ad l
1834Set default pair to its original value
1835T}
1836orig_colors oc oc T{
1837.ad l
1838Set all color pairs to the original ones
1839T}
1840initialize_color initc Ic T{
1841.ad l
1842initialize color #1 to (#2,#3,#4)
1843T}
1844initialize_pair initp Ip T{
1845.ad l
1846Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7)
1847T}
1848set_color_pair scp sp T{
1849.ad l
1850Set current color pair to #1
1851T}
1852set_foreground setf Sf T{
1853.ad l
1854Set foreground color #1
1855T}
1856set_background setb Sb T{
1857.ad l
1858Set background color #1
1859T}
1860change_char_pitch cpi ZA T{
1861.ad l
1862Change number of characters per inch to #1
1863T}
1864change_line_pitch lpi ZB T{
1865.ad l
1866Change number of lines per inch to #1
1867T}
1868change_res_horz chr ZC T{
1869.ad l
1870Change horizontal resolution to #1
1871T}
1872change_res_vert cvr ZD T{
1873.ad l
1874Change vertical resolution to #1
1875T}
1876define_char defc ZE T{
1877.ad l
1878Define a character #1, #2 dots wide, descender #3
1879T}
1880enter_doublewide_mode swidm ZF T{
1881.ad l
1882Enter double-wide mode
1883T}
1884.TE
1885.TS
1886center;
1887Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
1888enter_draft_quality sdrfq ZG T{
1889.ad l
1890Enter draft-quality mode
1891T}
1892enter_italics_mode sitm ZH T{
1893.ad l
1894Enter italic mode
1895T}
1896enter_leftward_mode slm ZI T{
1897.ad l
1898Start leftward carriage motion
1899T}
1900enter_micro_mode smicm ZJ T{
1901.ad l
1902Start micro-motion mode
1903T}
1904enter_near_letter_quality snlq ZK T{
1905.ad l
1906Enter NLQ mode
1907T}
1908enter_normal_quality snrmq ZL T{
1909.ad l
1910Enter normal-quality mode
1911T}
1912enter_shadow_mode sshm ZM T{
1913.ad l
1914Enter shadow-print mode
1915T}
1916enter_subscript_mode ssubm ZN T{
1917.ad l
1918Enter subscript mode
1919T}
1920enter_superscript_mode ssupm ZO T{
1921.ad l
1922Enter superscript mode
1923T}
1924enter_upward_mode sum ZP T{
1925.ad l
1926Start upward carriage motion
1927T}
1928exit_doublewide_mode rwidm ZQ T{
1929.ad l
1930End double-wide mode
1931T}
1932exit_italics_mode ritm ZR T{
1933.ad l
1934End italic mode
1935T}
1936exit_leftward_mode rlm ZS T{
1937.ad l
1938End left-motion mode
1939T}
1940exit_micro_mode rmicm ZT T{
1941.ad l
1942End micro-motion mode
1943T}
1944exit_shadow_mode rshm ZU T{
1945.ad l
1946End shadow-print mode
1947T}
1948exit_subscript_mode rsubm ZV T{
1949.ad l
1950End subscript mode
1951T}
1952exit_superscript_mode rsupm ZW T{
1953.ad l
1954End superscript mode
1955T}
1956exit_upward_mode rum ZX T{
1957.ad l
1958End reverse character motion
1959T}
1960micro_column_address mhpa ZY T{
1961.ad l
1962Like column_address in micro mode
1963T}
1964micro_down mcud1 ZZ T{
1965.ad l
1966Like cursor_down in micro mode
1967T}
1968micro_left mcub1 Za T{
1969.ad l
1970Like cursor_left in micro mode
1971T}
1972micro_right mcuf1 Zb T{
1973.ad l
1974Like cursor_right in micro mode
1975T}
1976micro_row_address mvpa Zc T{
1977.ad l
1978Like row_address #1 in micro mode
1979T}
1980micro_up mcuu1 Zd T{
1981.ad l
1982Like cursor_up in micro mode
1983T}
1984order_of_pins porder Ze T{
1985.ad l
1986Match software bits to print-head pins
1987T}
1988parm_down_micro mcud Zf T{
1989.ad l
1990Like parm_down_cursor in micro mode
1991T}
1992parm_left_micro mcub Zg T{
1993.ad l
1994Like parm_left_cursor in micro mode
1995T}
1996parm_right_micro mcuf Zh T{
1997.ad l
1998Like parm_right_cursor in micro mode
1999T}
2000parm_up_micro mcuu Zi T{
2001.ad l
2002Like parm_up_cursor in micro mode
2003T}
2004select_char_set scs Zj T{
2005.ad l
2006Select character set, #1
2007T}
2008set_bottom_margin smgb Zk T{
2009.ad l
2010Set bottom margin at current line
2011T}
2012set_bottom_margin_parm smgbp Zl T{
2013.ad l
2014Set bottom margin at line #1 or (if smgtp is not given) #2 lines from bottom
2015T}
2016set_left_margin_parm smglp Zm T{
2017.ad l
2018Set left (right) margin at column #1
2019T}
2020set_right_margin_parm smgrp Zn T{
2021.ad l
2022Set right margin at column #1
2023T}
2024set_top_margin smgt Zo T{
2025.ad l
2026Set top margin at current line
2027T}
2028set_top_margin_parm smgtp Zp T{
2029.ad l
2030Set top (bottom) margin at row #1
2031T}
2032start_bit_image sbim Zq T{
2033.ad l
2034Start printing bit image graphics
2035T}
2036start_char_set_def scsd Zr T{
2037.ad l
2038Start character set definition #1, with #2 characters in the set
2039T}
2040stop_bit_image rbim Zs T{
2041.ad l
2042Stop printing bit image graphics
2043T}
2044stop_char_set_def rcsd Zt T{
2045.ad l
2046End definition of character set #1
2047T}
2048subscript_characters subcs Zu T{
2049.ad l
2050List of subscriptable characters
2051T}
2052superscript_characters supcs Zv T{
2053.ad l
2054List of superscriptable characters
2055T}
2056these_cause_cr docr Zw T{
2057.ad l
2058Printing any of these characters causes CR
2059T}
2060zero_motion zerom Zx T{
2061.ad l
2062No motion for subsequent character
2063T}
2064.TE
2065.PP
2066.
2067The following string capabilities are present in the SVr4.0 term structure,
2068but were originally not documented in the man page.
2069.
2070.PP
2071.TS
2072center;
2073Lb Cb S Lb
2074Lb Lb Lb Lb
2075Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
2076\& Code \&
2077String Capability Name TI TC Description
2078_
2079char_set_names csnm Zy T{
2080.ad l
2081Produce #1'th item from list of character set names
2082T}
2083key_mouse kmous Km T{
2084.ad l
2085Mouse event has occurred
2086T}
2087mouse_info minfo Mi T{
2088.ad l
2089Mouse status information
2090T}
2091req_mouse_pos reqmp RQ T{
2092.ad l
2093Request mouse position
2094T}
2095get_mouse getm Gm T{
2096.ad l
2097Curses should get button events, parameter #1 not documented.
2098T}
2099set_a_foreground setaf AF T{
2100.ad l
2101Set foreground color to #1, using ANSI escape
2102T}
2103set_a_background setab AB T{
2104.ad l
2105Set background color to #1, using ANSI escape
2106T}
2107pkey_plab pfxl xl T{
2108.ad l
2109Program function key #1 to type string #2 and show string #3
2110T}
2111device_type devt dv T{
2112.ad l
2113Indicate language, codeset support
2114T}
2115code_set_init csin ci T{
2116.ad l
2117Init sequence for multiple codesets
2118T}
2119set0_des_seq s0ds s0 T{
2120.ad l
2121Shift to codeset 0 (EUC set 0, ASCII)
2122T}
2123set1_des_seq s1ds s1 T{
2124.ad l
2125Shift to codeset 1
2126T}
2127set2_des_seq s2ds s2 T{
2128.ad l
2129Shift to codeset 2
2130T}
2131set3_des_seq s3ds s3 T{
2132.ad l
2133Shift to codeset 3
2134T}
2135set_lr_margin smglr ML T{
2136.ad l
2137Set both left and right margins to #1, #2. (ML is not in BSD termcap).
2138T}
2139set_tb_margin smgtb MT T{
2140.ad l
2141Sets both top and bottom margins to #1, #2
2142T}
2143bit_image_repeat birep Xy T{
2144.ad l
2145Repeat bit image cell #1 #2 times
2146T}
2147bit_image_newline binel Zz T{
2148.ad l
2149Move to next row of the bit image
2150T}
2151bit_image_carriage_return bicr Yv T{
2152.ad l
2153Move to beginning of same row
2154T}
2155color_names colornm Yw T{
2156.ad l
2157Give name for color #1
2158T}
2159define_bit_image_region defbi Yx T{
2160.ad l
2161Define rectangular bit image region
2162T}
2163end_bit_image_region endbi Yy T{
2164.ad l
2165End a bit-image region
2166T}
2167set_color_band setcolor Yz T{
2168.ad l
2169Change to ribbon color #1
2170T}
2171set_page_length slines YZ T{
2172.ad l
2173Set page length to #1 lines
2174T}
2175display_pc_char dispc S1 T{
2176.ad l
2177Display PC character #1
2178T}
2179enter_pc_charset_mode smpch S2 T{
2180.ad l
2181Enter PC character display mode
2182T}
2183exit_pc_charset_mode rmpch S3 T{
2184.ad l
2185Exit PC character display mode
2186T}
2187enter_scancode_mode smsc S4 T{
2188.ad l
2189Enter PC scancode mode
2190T}
2191exit_scancode_mode rmsc S5 T{
2192.ad l
2193Exit PC scancode mode
2194T}
2195pc_term_options pctrm S6 T{
2196.ad l
2197PC terminal options
2198T}
2199scancode_escape scesc S7 T{
2200.ad l
2201Escape for scancode emulation
2202T}
2203alt_scancode_esc scesa S8 T{
2204.ad l
2205Alternate escape for scancode emulation
2206T}
2207.TE
2208.PP
2209.
2210The XSI Curses standard added these hardcopy capabilities.
2211They were used in some post-4.1 versions of System V curses,
2212e.g., Solaris 2.5 and IRIX 6.x.
2213Except for \fBYI\fP, the \fBncurses\fR termcap names for them are invented.
2214According to the XSI Curses standard, they have no termcap names.
2215If your compiled terminfo entries use these,
2216they may not be binary-compatible with System V terminfo
2217entries after SVr4.1; beware!
2218.
2219.PP
2220.TS
2221center;
2222Lb Cb S Lb
2223Lb Lb Lb Lb
2224Lbw(25n)2 Lbw(8n)2 Lb2 Lx.
2225\& Code \&
2226String Capability Name TI TC Description
2227_
2228enter_horizontal_hl_mode ehhlm Xh T{
2229.ad l
2230Enter horizontal highlight mode
2231T}
2232enter_left_hl_mode elhlm Xl T{
2233.ad l
2234Enter left highlight mode
2235T}
2236enter_low_hl_mode elohlm Xo T{
2237.ad l
2238Enter low highlight mode
2239T}
2240enter_right_hl_mode erhlm Xr T{
2241.ad l
2242Enter right highlight mode
2243T}
2244enter_top_hl_mode ethlm Xt T{
2245.ad l
2246Enter top highlight mode
2247T}
2248enter_vertical_hl_mode evhlm Xv T{
2249.ad l
2250Enter vertical highlight mode
2251T}
2252set_a_attributes sgr1 sA T{
2253.ad l
2254Define second set of video attributes #1-#6
2255T}
2256set_pglen_inch slength YI T{
2257.ad l
2258Set page length to #1 hundredth of an inch (some implementations use sL for termcap).
2259T}
2260.TE
2261.\"***************************************************************************
2262.\" Copyright 2018-2023,2024 Thomas E. Dickey *
2263.\" Copyright 1998-2016,2017 Free Software Foundation, Inc. *
2264.\" *
2265.\" Permission is hereby granted, free of charge, to any person obtaining a *
2266.\" copy of this software and associated documentation files (the *
2267.\" "Software"), to deal in the Software without restriction, including *
2268.\" without limitation the rights to use, copy, modify, merge, publish, *
2269.\" distribute, distribute with modifications, sublicense, and/or sell *
2270.\" copies of the Software, and to permit persons to whom the Software is *
2271.\" furnished to do so, subject to the following conditions: *
2272.\" *
2273.\" The above copyright notice and this permission notice shall be included *
2274.\" in all copies or substantial portions of the Software. *
2275.\" *
2276.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
2277.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
2278.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
2279.\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
2280.\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
2281.\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
2282.\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
2283.\" *
2284.\" Except as contained in this notice, the name(s) of the above copyright *
2285.\" holders shall not be used in advertising or otherwise to promote the *
2286.\" sale, use or other dealings in this Software without prior written *
2287.\" authorization. *
2288.\"***************************************************************************
2289.\"
2290.\" $Id: terminfo.tail,v 1.148 2024/04/20 21:24:19 tom Exp $
2291.ps +1
2292.SS "User-Defined Capabilities"
2293.
2294The preceding section listed the \fIpredefined\fP capabilities.
2295They deal with some special features for terminals no longer
2296(or possibly never) produced.
2297Occasionally there are special features of newer terminals which
2298are awkward or impossible to represent by reusing the predefined
2299capabilities.
2300.PP
2301\fI\%ncurses\fP addresses this limitation by allowing user-defined
2302capabilities.
2303The \fB@TIC@\fP and \fB@INFOCMP@\fP programs provide
2304the \fB\-x\fP option for this purpose.
2305When \fB\-x\fP is set,
2306\fB@TIC@\fP treats unknown capabilities as user-defined.
2307That is, if \fB@TIC@\fP encounters a capability name
2308which it does not recognize,
2309it infers its type (Boolean, number or string) from the syntax
2310and makes an extended table entry for that capability.
2311The \fBuse_extended_names\fP(3X) function makes this information
2312conditionally available to applications.
2313The \fI\%ncurses\fP library provides the data leaving most of the
2314behavior to applications:
2315.bP
2316User-defined capability strings whose name begins
2317with \*(``k\*('' are treated as function keys.
2318.bP
2319The types (Boolean, number, string) determined by \fB@TIC@\fP
2320can be inferred by successful calls on \fBtigetflag\fP, etc.
2321.bP
2322If the capability name happens to be two characters,
2323the capability is also available through the termcap interface.
2324.PP
2325While termcap is said to be extensible because it does not use a predefined set
2326of capabilities,
2327in practice it has been limited to the capabilities defined by
2328terminfo implementations.
2329As a rule,
2330user-defined capabilities intended for use by termcap applications should
2331be limited to Booleans and numbers to avoid running past the 1023 byte
2332limit assumed by termcap implementations and their applications.
2333In particular, providing extended sets of function keys (past the 60
2334numbered keys and the handful of special named keys) is best done using
2335the longer names available using terminfo.
2336.PP
2337The \fI\%ncurses\fP library uses a few of these user-defined
2338capabilities,
2339as described in \fBuser_caps\fR(5).
2340Other user-defined capabilities (including function keys) are
2341described in the terminal database, in the section on
2342.I "NCURSES USER-DEFINABLE CAPABILITIES"
2343.
2344.SS "A Sample Entry"
2345.
2346The following entry, describing an ANSI-standard terminal, is representative
2347of what a \fBterminfo\fP entry for a modern terminal typically looks like.
2348.PP
2349.EX
2350\s-2ansi|ansi/pc\-term compatible with color,
2351 am, mc5i, mir, msgr,
2352 colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
2353 acsc=+\e020\e,\e021\-\e030.\*^Y0\e333\(ga\e004a\e261f\e370g\e361h\e260
2354 j\e331k\e277l\e332m\e300n\e305o\*~p\e304q\e304r\e304s_t\e303
2355 u\e264v\e301w\e302x\e263y\e363z\e362{\e343|\e330}\e234\*~\e376,
2356 bel=\*^G, blink=\eE[5m, bold=\eE[1m, cbt=\eE[Z, clear=\eE[H\eE[J,
2357 cr=\*^M, cub=\eE[%p1%dD, cub1=\eE[D, cud=\eE[%p1%dB, cud1=\eE[B,
2358 cuf=\eE[%p1%dC, cuf1=\eE[C, cup=\eE[%i%p1%d;%p2%dH,
2359 cuu=\eE[%p1%dA, cuu1=\eE[A, dch=\eE[%p1%dP, dch1=\eE[P,
2360 dl=\eE[%p1%dM, dl1=\eE[M, ech=\eE[%p1%dX, ed=\eE[J, el=\eE[K,
2361 el1=\eE[1K, home=\eE[H, hpa=\eE[%i%p1%dG, ht=\eE[I, hts=\eEH,
2362 ich=\eE[%p1%d@, il=\eE[%p1%dL, il1=\eE[L, ind=\*^J,
2363 indn=\eE[%p1%dS, invis=\eE[8m, kbs=\*^H, kcbt=\eE[Z, kcub1=\eE[D,
2364 kcud1=\eE[B, kcuf1=\eE[C, kcuu1=\eE[A, khome=\eE[H, kich1=\eE[L,
2365 mc4=\eE[4i, mc5=\eE[5i, nel=\er\eE[S, op=\eE[39;49m,
2366 rep=%p1%c\eE[%p2%{1}%\-%db, rev=\eE[7m, rin=\eE[%p1%dT,
2367 rmacs=\eE[10m, rmpch=\eE[10m, rmso=\eE[m, rmul=\eE[m,
2368 s0ds=\eE(B, s1ds=\eE)B, s2ds=\eE*B, s3ds=\eE+B,
2369 setab=\eE[4%p1%dm, setaf=\eE[3%p1%dm,
2370 sgr=\eE[0;10%?%p1%t;7%;
2371 %?%p2%t;4%;
2372 %?%p3%t;7%;
2373 %?%p4%t;5%;
2374 %?%p6%t;1%;
2375 %?%p7%t;8%;
2376 %?%p9%t;11%;m,
2377 sgr0=\eE[0;10m, smacs=\eE[11m, smpch=\eE[11m, smso=\eE[7m,
2378 smul=\eE[4m, tbc=\eE[3g, u6=\eE[%i%d;%dR, u7=\eE[6n,
2379 u8=\eE[?%[;0123456789]c, u9=\eE[c, vpa=\eE[%i%p1%dd,
2380.EE
2381.PP
2382Entries may continue onto multiple lines by placing white space at
2383the beginning of each line except the first.
2384Comments may be included on lines beginning with \*(``#\*(''.
2385Capabilities in
2386.I terminfo
2387are of three types:
2388.bP
2389Boolean capabilities which indicate that the terminal has
2390some particular feature,
2391.bP
2392numeric capabilities giving the size of the terminal
2393or the size of particular delays, and
2394.bP
2395string
2396capabilities, which give a sequence which can be used to perform particular
2397terminal operations.
2398.SS "Types of Capabilities"
2399All capabilities have names.
2400For instance, the fact that
2401ANSI-standard terminals have
2402.I "automatic margins"
2403(i.e., an automatic return and line-feed
2404when the end of a line is reached) is indicated by the capability \fBam\fP.
2405Hence the description of ansi includes \fBam\fP.
2406Numeric capabilities are followed by the character \*(``#\*(''
2407and then a positive value.
2408Thus \fBcols\fP, which indicates the number of columns the terminal has,
2409gives the value \*(``80\*('' for ansi.
2410Values for numeric capabilities may be specified in
2411decimal,
2412octal, or
2413hexadecimal,
2414using the C programming language conventions
2415(e.g., 255, 0377 and 0xff or 0xFF).
2416.PP
2417Finally, string valued capabilities,
2418such as \fBel\fP (clear to end of line sequence)
2419are given by the two-character code,
2420an \*(``=\*('', and then
2421a string ending at the next following \*(``,\*(''.
2422.PP
2423A number of escape sequences are provided in the string valued capabilities
2424for easy encoding of characters there:
2425.bP
2426Both \fB\eE\fP and \fB\ee\fP
2427map to an \s-1ESCAPE\s0 character,
2428.bP
2429\fB\*^\f(BIx\fR maps to a control-\fIx\fP for any appropriate \fIx\fP,
2430and
2431.bP
2432the sequences
2433.RS 6
2434.PP
2435\fB\en\fP, \fB\el\fP, \fB\er\fP, \fB\et\fP, \fB\eb\fP, \fB\ef\fP, and \fB\es\fP
2436.RE
2437.IP
2438produce
2439.RS 6
2440.PP
2441\fInewline\fP, \fIline-feed\fP, \fIreturn\fP, \fItab\fP, \fIbackspace\fP, \fIform-feed\fP, and \fIspace\fP,
2442.RE
2443.IP
2444respectively.
2445.PP
2446X/Open Curses does not say what \*(``appropriate \fIx\fP\*('' might be.
2447In practice, that is a printable ASCII graphic character.
2448The special case \*(``\*^?\*('' is interpreted as DEL (127).
2449In all other cases, the character value is AND'd with 0x1f,
2450mapping to ASCII control codes in the range 0 through 31.
2451.PP
2452Other escapes include
2453.bP
2454\fB\e\*^\fP for \fB\*^\fP,
2455.bP
2456\fB\e\e\fP for \fB\e\fP,
2457.bP
2458\fB\e\fP, for comma,
2459.bP
2460\fB\e:\fP for \fB:\fP,
2461.bP
2462and \fB\e0\fP for null.
2463.IP
2464\fB\e0\fP will produce \e200, which does not terminate a string but behaves
2465as a null character on most terminals, providing CS7 is specified.
2466See \fBstty\fP(1).
2467.IP
2468The reason for this quirk is to maintain binary compatibility of the
2469compiled terminfo files with other implementations,
2470e.g., the SVr4 systems, which document this.
2471Compiled terminfo files use null-terminated strings, with no lengths.
2472Modifying this would require a new binary format,
2473which would not work with other implementations.
2474.PP
2475Finally, characters may be given as three octal digits after a \fB\e\fP.
2476.PP
2477A delay in milliseconds may appear anywhere in a string capability, enclosed in
2478$<..> brackets, as in \fBel\fP=\eEK$<5>,
2479and padding characters are supplied by \fBtputs\fP(3X)
2480to provide this delay.
2481.bP
2482The delay must be a number with at most one decimal
2483place of precision;
2484it may be followed by suffixes \*(``*\*('' or \*(``/\*('' or both.
2485.bP
2486A \*(``*\*(''
2487indicates that the padding required is proportional to the number of lines
2488affected by the operation, and the amount given is the per-affected-unit
2489padding required.
2490(In the case of insert character, the factor is still the
2491number of \fIlines\fP affected.)
2492.IP
2493Normally, padding is advisory if the device has the \fBxon\fP
2494capability; it is used for cost computation but does not trigger delays.
2495.bP
2496A \*(``/\*(''
2497suffix indicates that the padding is mandatory and forces a delay of the given
2498number of milliseconds even on devices for which \fBxon\fP is present to
2499indicate flow control.
2500.PP
2501Sometimes individual capabilities must be commented out.
2502To do this, put a period before the capability name.
2503For example, see the second
2504.B ind
2505in the example above.
2506.br
2507.ne 5
2508.SS "Fetching Compiled Descriptions"
2509Terminal descriptions in \fI\%ncurses\fP are stored in terminal
2510databases.
2511These databases, which are found by their pathname,
2512may be configured either as directory trees or hashed databases
2513(see \fBterm\fR(5)),
2514.PP
2515The library uses a compiled-in list of pathnames,
2516which can be overridden by environment variables.
2517Before starting to search,
2518\fI\%ncurses\fP checks the search list,
2519eliminating duplicates and pathnames where no terminal database is found.
2520The \fI\%ncurses\fP library reads the first description
2521which passes its consistency checks.
2522.bP
2523The environment variable \fBTERMINFO\fR is checked first, for
2524a terminal database containing the terminal description.
2525.bP
2526Next,
2527\fI\%ncurses\fP looks in \fI$HOME/.terminfo\fP
2528for a compiled description.
2529.IP
2530This is an optional feature which may be omitted entirely from
2531the library, or limited to prevent accidental use by privileged applications.
2532.bP
2533Next,
2534if the environment variable \fI\%TERMINFO_DIRS\fP is set,
2535\fI\%ncurses\fP interprets the contents of that variable
2536as a list of colon-separated pathnames of terminal databases to be searched.
2537.IP
2538An empty pathname (i.e., if the variable begins or ends
2539with a colon, or contains adjacent colons)
2540is interpreted as the system location \fI\*d\fP.
2541.bP
2542Finally, \fI\%ncurses\fP searches these compiled-in locations:
2543.RS
2544.bP
2545a list of directories (@TERMINFO_DIRS@), and
2546.bP
2547the system terminfo directory, \fI\*d\fP
2548.RE
2549.PP
2550The \fBTERMINFO\fP variable can contain a terminal description instead
2551of the pathname of a terminal database.
2552If this variable begins with \*(``hex:\*('' or \*(``b64:\*(''
2553then \fI\%ncurses\fP reads a terminal description from
2554hexadecimal- or base64-encoded data,
2555and if that description matches the name sought, will use that.
2556This encoded data can be set using the \*(``\-Q\*('' option of
2557\fB@TIC@\fR or \fB@INFOCMP@\fR.
2558.PP
2559The preceding addresses the usual configuration of \fI\%ncurses\fP,
2560which uses terminal descriptions prepared in \fIterminfo\fP format.
2561While \fItermcap\fP is less expressive,
2562\fI\%ncurses\fP can also be configured to read \fItermcap\fP
2563descriptions.
2564In that configuration,
2565it checks the \fI\%TERMCAP\fP and \fI\%TERMPATH\fP variables
2566(for content and search path,
2567respectively)
2568after the system terminal database.
2569.SS "Preparing Descriptions"
2570We now outline how to prepare descriptions of terminals.
2571The most effective way to prepare a terminal description is by imitating
2572the description of a similar terminal in
2573.I terminfo
2574and to build up a description gradually, using partial descriptions
2575with
2576.I vi
2577or some other screen-oriented program to check that they are correct.
2578Be aware that a very unusual terminal may expose deficiencies in
2579the ability of the
2580.I terminfo
2581file to describe it
2582or bugs in the screen-handling code of the test program.
2583.PP
2584To get the padding for insert line right (if the terminal manufacturer
2585did not document it) a severe test is to edit a large file at 9600 baud,
2586delete 16 or so lines from the middle of the screen, then hit the \*(``u\*(''
2587key several times quickly.
2588If the terminal messes up, more padding is usually needed.
2589A similar test can be used for insert character.
2590.SS "Basic Capabilities"
2591The number of columns on each line for the terminal is given by the
2592\fBcols\fP numeric capability.
2593If the terminal is a \s-1CRT\s0, then the
2594number of lines on the screen is given by the \fBlines\fP capability.
2595If the terminal wraps around to the beginning of the next line when
2596it reaches the right margin, then it should have the \fBam\fP capability.
2597If the terminal can clear its screen, leaving the cursor in the home
2598position, then this is given by the \fBclear\fP string capability.
2599If the terminal overstrikes
2600(rather than clearing a position when a character is struck over)
2601then it should have the \fBos\fP capability.
2602If the terminal is a printing terminal, with no soft copy unit,
2603give it both
2604.B hc
2605and
2606.BR os .
2607.RB ( os
2608applies to storage scope terminals, such as \s-1TEKTRONIX\s+1 4010
2609series, as well as hard copy and APL terminals.)
2610If there is a code to move the cursor to the left edge of the current
2611row, give this as
2612.BR cr .
2613(Normally this will be carriage return, control/M.)
2614If there is a code to produce an audible signal (bell, beep, etc)
2615give this as
2616.BR bel .
2617.PP
2618If there is a code to move the cursor one position to the left
2619(such as backspace) that capability should be given as
2620.BR cub1 .
2621Similarly, codes to move to the right, up, and down should be
2622given as
2623.BR cuf1 ,
2624.BR cuu1 ,
2625and
2626.BR cud1 .
2627These local cursor motions should not alter the text they pass over,
2628for example, you would not normally use \*(``\fBcuf1\fP=\ \*('' because the
2629space would erase the character moved over.
2630.PP
2631A very important point here is that the local cursor motions encoded
2632in
2633.I terminfo
2634are undefined at the left and top edges of a \s-1CRT\s0 terminal.
2635Programs should never attempt to backspace around the left edge,
2636unless
2637.B bw
2638is given,
2639and never attempt to go up locally off the top.
2640In order to scroll text up, a program will go to the bottom left corner
2641of the screen and send the
2642.B ind
2643(index) string.
2644.PP
2645To scroll text down, a program goes to the top left corner
2646of the screen and sends the
2647.B ri
2648(reverse index) string.
2649The strings
2650.B ind
2651and
2652.B ri
2653are undefined when not on their respective corners of the screen.
2654.PP
2655Parameterized versions of the scrolling sequences are
2656.B indn
2657and
2658.B rin
2659which have the same semantics as
2660.B ind
2661and
2662.B ri
2663except that they take one parameter, and scroll that many lines.
2664They are also undefined except at the appropriate edge of the screen.
2665.PP
2666The \fBam\fP capability tells whether the cursor sticks at the right
2667edge of the screen when text is output, but this does not necessarily
2668apply to a
2669.B cuf1
2670from the last column.
2671The only local motion which is defined from the left edge is if
2672.B bw
2673is given, then a
2674.B cub1
2675from the left edge will move to the right edge of the previous row.
2676If
2677.B bw
2678is not given, the effect is undefined.
2679This is useful for drawing a box around the edge of the screen, for example.
2680If the terminal has switch selectable automatic margins,
2681the
2682.I terminfo
2683file usually assumes that this is on; i.e., \fBam\fP.
2684If the terminal has a command which moves to the first column of the next
2685line, that command can be given as
2686.B nel
2687(newline).
2688It does not matter if the command clears the remainder of the current line,
2689so if the terminal has no
2690.B cr
2691and
2692.B lf
2693it may still be possible to craft a working
2694.B nel
2695out of one or both of them.
2696.PP
2697These capabilities suffice to describe
2698hard-copy and \*(``glass-tty\*('' terminals.
2699Thus the model 33 teletype is described as
2700.PP
2701.EX
2702.\".in -2
2703\s-133\||\|tty33\||\|tty\||\|model 33 teletype,
2704 bel=\*^G, cols#72, cr=\*^M, cud1=\*^J, hc, ind=\*^J, os,\s+1
2705.\".in +2
2706.EE
2707.PP
2708while the Lear Siegler \s-1ADM-3\s0 is described as
2709.PP
2710.EX
2711.\".in -2
2712\s-1adm3\||\|3\||\|lsi adm3,
2713 am, bel=\*^G, clear=\*^Z, cols#80, cr=\*^M, cub1=\*^H, cud1=\*^J,
2714 ind=\*^J, lines#24,\s+1
2715.\".in +2
2716.EE
2717.SS "Parameterized Strings"
2718Cursor addressing and other strings requiring parameters
2719in the terminal are described by a
2720parameterized string capability,
2721with \fIprintf\fP-like escapes such as \fI%x\fP in it.
2722For example, to address the cursor, the
2723.B cup
2724capability is given, using two parameters:
2725the row and column to address to.
2726(Rows and columns are numbered from zero and refer to the
2727physical screen visible to the user, not to any unseen memory.)
2728If the terminal has memory relative cursor addressing,
2729that can be indicated by
2730.BR mrcup .
2731.PP
2732The parameter mechanism uses a stack and special \fB%\fP codes
2733to manipulate it.
2734Typically a sequence will push one of the
2735parameters onto the stack and then print it in some format.
2736Print (e.g., \*(``%d\*('') is a special case.
2737Other operations, including \*(``%t\*('' pop their operand from the stack.
2738It is noted that more complex operations are often necessary,
2739e.g., in the \fBsgr\fP string.
2740.PP
2741The \fB%\fP encodings have the following meanings:
2742.TP 5
2743\fB%%\fP
2744outputs \*(``%\*(''
2745.TP
2746\fB%\fI[[\fR:\fI]flags][width[.precision]][\fBdoxXs\fI]\fR
2747as in \fBprintf\fP(3), flags are \fI[\-+#]\fP and \fIspace\fP.
2748Use a \*(``:\*('' to allow the next character to be a \*(``\-\*('' flag,
2749avoiding interpreting \*(``%\-\*('' as an operator.
2750.TP
2751\fB%c\fP
2752print \fIpop()\fP like %c in \fBprintf\fP
2753.TP
2754\fB%s\fP
2755print \fIpop()\fP like %s in \fBprintf\fP
2756.TP
2757\fB%p\fI[1\-9]\fR
2758push \fIi\fP'th parameter
2759.TP
2760\fB%P\fI[a\-z]\fR
2761set dynamic variable \fI[a\-z]\fP to \fIpop()\fP
2762.TP
2763\fB%g\fI[a\-z]\fR
2764get dynamic variable \fI[a\-z]\fP and push it
2765.TP
2766\fB%P\fI[A\-Z]\fR
2767set static variable \fI[a\-z]\fP to \fIpop()\fP
2768.TP
2769\fB%g\fI[A\-Z]\fR
2770get static variable \fI[a\-z]\fP and push it
2771.IP
2772The terms \*(``static\*('' and \*(``dynamic\*('' are misleading.
2773Historically, these are simply two different sets of variables,
2774whose values are not reset between calls to \fBtparm\fP(3X).
2775However, that fact is not documented in other implementations.
2776Relying on it will adversely impact portability to other implementations:
2777.RS
2778.bP
2779SVr2 curses supported \fIdynamic\fP variables.
2780Those are set only by a \fB%P\fP operator.
2781A \fB%g\fP for a given variable without first setting it with \fB%P\fP
2782will give unpredictable results, because dynamic variables are
2783an uninitialized local array on the stack in the \fBtparm\fP function.
2784.bP
2785SVr3.2 curses supported \fIstatic\fP variables.
2786Those are an array in the \fI\%TERMINAL\fP
2787structure (declared in \fBterm.h\fP),
2788and are zeroed automatically when the \fBsetupterm\fP function
2789allocates the data.
2790.bP
2791SVr4 curses made no further improvements
2792to the \fIdynamic/static\fP variable feature.
2793.bP
2794Solaris XPG4 curses does not distinguish between \fIdynamic\fP and
2795\fIstatic\fP variables.
2796They are the same.
2797Like SVr4 curses, XPG4 curses does not initialize these explicitly.
2798.bP
2799Before version 6.3,
2800\fI\%ncurses\fP stores both \fIdynamic\fP and \fIstatic\fP
2801variables in persistent storage, initialized to zeros.
2802.bP
2803Beginning with version 6.3,
2804\fI\%ncurses\fP stores \fIstatic\fP and \fIdynamic\fP
2805variables in the same manner as SVr4.
2806.RS
2807.bP
2808Unlike other implementations, \fI\%ncurses\fP zeros dynamic variables
2809before the first \fB%g\fP or \fB%P\fP operator.
2810.bP
2811Like SVr2,
2812the scope of dynamic variables in \fI\%ncurses\fP
2813is within the current call to
2814\fBtparm\fP.
2815Use static variables if persistent storage is needed.
2816.RE
2817.RE
2818.TP
2819\fB%\*'\fIc\fB\*'\fR
2820char constant \fIc\fP
2821.TP
2822\fB%{\fInn\fB}\fR
2823integer constant \fInn\fP
2824.TP
2825\fB%l\fP
2826push strlen(pop)
2827.TP
2828\fB%+\fP, \fB%\-\fP, \fB%*\fP, \fB%/\fP, \fB%m\fP
2829arithmetic (%m is \fImod\fP): \fIpush(pop() op pop())\fP
2830.TP
2831\fB%&\fP, \fB%|\fP, \fB%\*^\fP
2832bit operations (AND, OR and exclusive-OR): \fIpush(pop() op pop())\fP
2833.TP
2834\fB%=\fP, \fB%>\fP, \fB%<\fP
2835logical operations: \fIpush(pop() op pop())\fP
2836.TP
2837\fB%A\fP, \fB%O\fP
2838logical AND and OR operations (for conditionals)
2839.TP
2840\fB%!\fP, \fB%\*~\fP
2841unary operations (logical and bit complement): \fIpush(op pop())\fP
2842.TP
2843\fB%i\fP
2844add 1 to first two parameters (for ANSI terminals)
2845.TP
2846\fB%?\fP \fIexpr\fP \fB%t\fP \fIthenpart\fP \fB%e\fP \fIelsepart\fP \fB%;\fP
2847This forms an if-then-else.
2848The \fB%e\fP \fIelsepart\fP is optional.
2849Usually the \fB%?\fP \fIexpr\fP part pushes a value onto the stack,
2850and \fB%t\fP pops it from the stack, testing if it is nonzero (true).
2851If it is zero (false), control passes to the \fB%e\fP (else) part.
2852.IP
2853It is possible to form else-if's a la Algol 68:
2854.RS
2855\fB%?\fP c\d1\u \fB%t\fP b\d1\u \fB%e\fP c\d2\u \fB%t\fP b\d2\u \fB%e\fP c\d3\u \fB%t\fP b\d3\u \fB%e\fP c\d4\u \fB%t\fP b\d4\u \fB%e\fP \fB%;\fP
2856.RE
2857.IP
2858where c\di\u are conditions, b\di\u are bodies.
2859.IP
2860Use the \fB\-f\fP option of \fB@TIC@\fP or \fB@INFOCMP@\fP to see
2861the structure of if-then-else's.
2862Some strings, e.g., \fBsgr\fP can be very complicated when written
2863on one line.
2864The \fB\-f\fP option splits the string into lines with the parts indented.
2865.PP
2866Binary operations are in postfix form with the operands in the usual order.
2867That is, to get x\-5 one would use \*(``%gx%{5}%\-\*(''.
2868\fB%P\fP and \fB%g\fP variables are
2869persistent across escape-string evaluations.
2870.PP
2871Consider the HP2645, which, to get to row 3 and column 12, needs
2872to be sent \eE&a12c03Y padded for 6 milliseconds.
2873The order of the rows and columns is inverted here,
2874and the row and column are printed as two digits.
2875The corresponding terminal description is expressed thus:
2876.RS
2877cup=\eE&a%p2%dc%p1%dY$<6>,
2878.RE
2879.PP
2880The Microterm \s-1ACT-IV\s0 needs the current row and column sent
2881preceded by a \fB\*^T\fP, with the row and column simply encoded in binary,
2882.RS
2883cup=\*^T%p1%c%p2%c
2884.RE
2885.PP
2886Terminals which use \*(``%c\*('' need to be able to
2887backspace the cursor (\fBcub1\fP),
2888and to move the cursor up one line on the screen (\fBcuu1\fP).
2889This is necessary because it is not always safe to transmit \fB\en\fP
2890\fB\*^D\fP and \fB\er\fP, as the system may change or discard them.
2891(The library routines dealing with terminfo set tty modes so that
2892tabs are never expanded, so \et is safe to send.
2893This turns out to be essential for the Ann Arbor 4080.)
2894.PP
2895A final example is the \s-1LSI ADM\s0-3a, which uses row and column
2896offset by a blank character, thus
2897.RS
2898cup=\eE=%p1%\*' \*'%+%c%p2%\*' \*'%+%c
2899.RE
2900.PP
2901After sending \*(``\eE=\*('', this pushes the first parameter, pushes the
2902ASCII value for a space (32), adds them (pushing the sum on the stack
2903in place of the two previous values) and outputs that value as a character.
2904Then the same is done for the second parameter.
2905More complex arithmetic is possible using the stack.
2906.SS "Cursor Motions"
2907If the terminal has a fast way to home the cursor
2908(to very upper left corner of screen) then this can be given as
2909\fBhome\fP; similarly a fast way of getting to the lower left-hand corner
2910can be given as \fBll\fP; this may involve going up with \fBcuu1\fP
2911from the home position,
2912but a program should never do this itself (unless \fBll\fP does) because it
2913can make no assumption about the effect of moving up from the home position.
2914Note that the home position is the same as addressing to (0,0):
2915to the top left corner of the screen, not of memory.
2916(Thus, the \eEH sequence on HP terminals cannot be used for
2917.BR home .)
2918.PP
2919If the terminal has row or column absolute cursor addressing,
2920these can be given as single parameter capabilities
2921.B hpa
2922(horizontal position absolute)
2923and
2924.B vpa
2925(vertical position absolute).
2926Sometimes these are shorter than the more general two parameter
2927sequence (as with the hp2645) and can be used in preference to
2928.BR cup .
2929If there are parameterized local motions (e.g., move
2930.I n
2931spaces to the right) these can be given as
2932.BR cud ,
2933.BR cub ,
2934.BR cuf ,
2935and
2936.B cuu
2937with a single parameter indicating how many spaces to move.
2938These are primarily useful if the terminal does not have
2939.BR cup ,
2940such as the \s-1TEKTRONIX\s+1 4025.
2941.PP
2942If the terminal needs to be in a special mode when running
2943a program that uses these capabilities,
2944the codes to enter and exit this mode can be given
2945as \fBsmcup\fP and \fBrmcup\fP.
2946This arises, for example, from terminals like the Concept with more than
2947one page of memory.
2948If the terminal has only memory relative cursor addressing and not screen
2949relative cursor addressing, a one screen-sized window must be fixed into
2950the terminal for cursor addressing to work properly.
2951This is also used for the \s-1TEKTRONIX\s+1 4025,
2952where
2953.B smcup
2954sets the command character to be the one used by terminfo.
2955If the \fBsmcup\fP sequence will not restore the screen after an
2956\fBrmcup\fP sequence is output (to the state prior to outputting
2957\fBrmcup\fP), specify \fBnrrmc\fP.
2958.SS Margins
2959SVr4 (and X/Open Curses)
2960list several string capabilities for setting margins.
2961Two were intended for use with terminals,
2962and another six were intended for use with printers.
2963.bP
2964The two terminal capabilities assume that the terminal may have
2965the capability of setting the left and/or right margin at the current
2966cursor column position.
2967.bP
2968The printer capabilities assume that the printer may have
2969two types of capability:
2970.RS
2971.bP
2972the ability to set a top and/or bottom margin using the current
2973line position, and
2974.bP
2975parameterized capabilities for setting the top, bottom, left, right margins
2976given the number of rows or columns.
2977.RE
2978.PP
2979In practice, the categorization into \*(``terminal\*('' and \*(``printer\*(''
2980is not suitable:
2981.bP
2982The AT&T SVr4 terminal database uses \fBsmgl\fP four times,
2983for AT&T hardware.
2984.IP
2985Three of the four are printers.
2986They lack the ability to set left/right margins by specifying the column.
2987.bP
2988Other (non-AT&T) terminals may support margins
2989but using different assumptions from AT&T.
2990.IP
2991For instance, the DEC VT420 supports left/right margins,
2992but only using a column parameter.
2993As an added complication, the VT420 uses two settings to fully enable
2994left/right margins (left/right margin mode, and origin mode).
2995The former enables the margins, which causes printed text
2996to wrap within margins, but the latter is needed to prevent
2997cursor-addressing outside those margins.
2998.bP
2999Both DEC VT420 left/right margins are set with a single control sequence.
3000If either is omitted, the corresponding margin is set to the left or
3001right edge of the display (rather than leaving the margin unmodified).
3002.PP
3003These are the margin-related capabilities:
3004.PP
3005.TS
3006center;
3007lb lb
3008lb l .
3009Name Description
3010_
3011smgl Set left margin at current column
3012smgr Set right margin at current column
3013smgb Set bottom margin at current line
3014smgt Set top margin at current line
3015smgbp Set bottom margin at line \fIN\fP
3016smglp Set left margin at column \fIN\fP
3017smgrp Set right margin at column \fIN\fP
3018smgtp Set top margin at line \fIN\fP
3019smglr Set both left and right margins to \fIL\fP and \fIR\fP
3020smgtb Set both top and bottom margins to \fIT\fP and \fIB\fP
3021.TE
3022.PP
3023When writing an application that
3024uses these string capabilities,
3025the pairs should be first checked to see
3026if each capability in the pair is set or only one is set:
3027.bP
3028If both \fBsmglp\fP and \fBsmgrp\fP are set,
3029each is used with a single argument, \fIN\fP,
3030that gives the column number of the left and right margin, respectively.
3031.bP
3032If both \fBsmgtp\fP and \fBsmgbp\fP are set,
3033each is used to set the top and bottom margin,
3034respectively:
3035.RS 4
3036.bP
3037\fBsmgtp\fP is used with a single argument, \fIN\fP,
3038the line number of the top margin.
3039.bP
3040\fBsmgbp\fP is used with two arguments, \fIN\fP and \fIM\fP,
3041that give the line number of the bottom margin,
3042the first counting from the top of the
3043page and the second counting from the bottom.
3044This accommodates the two styles of specifying
3045the bottom margin in different manufacturers' printers.
3046.RE
3047.IP
3048When designing a terminfo entry for a
3049printer that has a settable bottom margin,
3050only the first or second argument should be used, depending on the printer.
3051When developing an application that uses \fBsmgbp\fP to set the bottom margin,
3052both arguments must be given.
3053.PP
3054Conversely, when only one capability in the pair is set:
3055.bP
3056If only one of \fBsmglp\fP and \fBsmgrp\fP is set,
3057then it is used with two arguments,
3058the column number of the left and right margins, in that order.
3059.bP
3060Likewise, if only one of \fBsmgtp\fP and \fBsmgbp\fP is set, then it
3061is used with two arguments that give the top and bottom margins,
3062in that order, counting from the top of the page.
3063.IP
3064When designing a terminfo entry for a printer that requires setting both
3065left and right or top and bottom margins simultaneously,
3066only one capability in the pairs
3067\fBsmglp\fP and \fBsmgrp\fP or
3068\fBsmgtp\fP and \fBsmgbp\fP should be defined,
3069leaving the other unset.
3070.PP
3071Except for very old terminal descriptions, e.g., those developed for SVr4,
3072the scheme just described should be considered obsolete.
3073An improved set of capabilities was added late in the SVr4 releases
3074(\fBsmglr\fP and \fBsmgtb\fP),
3075which explicitly use two parameters for setting the left/right or top/bottom
3076margins.
3077.PP
3078When setting margins, the line- and column-values are zero-based.
3079.PP
3080The \fBmgc\fP string capability should be defined.
3081Applications such as \fBtabs\fP(1) rely upon this to reset all margins.
3082.\"
3083.SS "Area Clears"
3084If the terminal can clear from the current position to the end of the
3085line, leaving the cursor where it is, this should be given as \fBel\fP.
3086If the terminal can clear from the beginning of the line to the current
3087position inclusive, leaving
3088the cursor where it is, this should be given as \fBel1\fP.
3089If the terminal can clear from the current position to the end of the
3090display, then this should be given as \fBed\fP.
3091\fBEd\fP is only defined from the first column of a line.
3092(Thus, it can be simulated by a request to delete a large number of lines,
3093if a true
3094.B ed
3095is not available.)
3096.\"
3097.SS "Insert/Delete Line and Vertical Motions"
3098If the terminal can open a new blank line before the line where the cursor
3099is, this should be given as \fBil1\fP; this is done only from the first
3100position of a line.
3101The cursor must then appear on the newly blank line.
3102If the terminal can delete the line which the cursor is on, then this
3103should be given as \fBdl1\fP; this is done only from the first position on
3104the line to be deleted.
3105Versions of
3106.B il1
3107and
3108.B dl1
3109which take a single parameter and insert or delete that many lines can
3110be given as
3111.B il
3112and
3113.BR dl .
3114.PP
3115If the terminal has a settable scrolling region (like the vt100)
3116the command to set this can be described with the
3117.B csr
3118capability, which takes two parameters:
3119the top and bottom lines of the scrolling region.
3120The cursor position is, alas, undefined after using this command.
3121.PP
3122It is possible to get the effect of insert or delete line using
3123.B csr
3124on a properly chosen region; the
3125.B sc
3126and
3127.B rc
3128(save and restore cursor) commands may be useful for ensuring that
3129your synthesized insert/delete string does not move the cursor.
3130(Note that the \fB\%ncurses\fP(3X) library does this synthesis
3131automatically, so you need not compose insert/delete strings for
3132an entry with \fBcsr\fP).
3133.PP
3134Yet another way to construct insert and delete might be to use a combination of
3135index with the memory-lock feature found on some terminals (like the HP-700/90
3136series, which however also has insert/delete).
3137.PP
3138Inserting lines at the top or bottom of the screen can also be
3139done using
3140.B ri
3141or
3142.B ind
3143on many terminals without a true insert/delete line,
3144and is often faster even on terminals with those features.
3145.PP
3146The Boolean \fBnon_dest_scroll_region\fP should be set if each scrolling
3147window is effectively a view port on a screen-sized canvas.
3148To test for
3149this capability, create a scrolling region in the middle of the screen,
3150write something to the bottom line, move the cursor to the top of the region,
3151and do \fBri\fP followed by \fBdl1\fP or \fBind\fP.
3152If the data scrolled
3153off the bottom of the region by the \fBri\fP re-appears, then scrolling
3154is non-destructive.
3155System V and X/Open Curses expect that \fBind\fP, \fBri\fP,
3156\fBindn\fP, and \fBrin\fP will simulate destructive scrolling; their
3157documentation cautions you not to define \fBcsr\fP unless this is true.
3158This \fBcurses\fP implementation is more liberal and will do explicit erases
3159after scrolling if \fBndsrc\fP is defined.
3160.PP
3161If the terminal has the ability to define a window as part of
3162memory, which all commands affect,
3163it should be given as the parameterized string
3164.BR wind .
3165The four parameters are the starting and ending lines in memory
3166and the starting and ending columns in memory, in that order.
3167.PP
3168If the terminal can retain display memory above, then the
3169\fBda\fP capability should be given; if display memory can be retained
3170below, then \fBdb\fP should be given.
3171These indicate
3172that deleting a line or scrolling may bring non-blank lines up from below
3173or that scrolling back with \fBri\fP may bring down non-blank lines.
3174.SS "Insert/Delete Character"
3175There are two basic kinds of intelligent terminals with respect to
3176insert/delete character which can be described using
3177.IR terminfo .
3178The most common insert/delete character operations affect only the characters
3179on the current line and shift characters off the end of the line rigidly.
3180Other terminals, such as the Concept 100 and the Perkin Elmer Owl, make
3181a distinction between typed and untyped blanks on the screen, shifting
3182upon an insert or delete only to an untyped blank on the screen which is
3183either eliminated, or expanded to two untyped blanks.
3184.PP
3185You can determine the
3186kind of terminal you have by clearing the screen and then typing
3187text separated by cursor motions.
3188Type \*(``abc\ \ \ \ def\*('' using local
3189cursor motions (not spaces) between the \*(``abc\*('' and the \*(``def\*(''.
3190Then position the cursor before the \*(``abc\*('' and put the terminal in insert
3191mode.
3192If typing characters causes the rest of the line to shift
3193rigidly and characters to fall off the end, then your terminal does
3194not distinguish between blanks and untyped positions.
3195If the \*(``abc\*(''
3196shifts over to the \*(``def\*('' which then move together around the end of the
3197current line and onto the next as you insert, you have the second type of
3198terminal, and should give the capability \fBin\fP, which stands for
3199\*(``insert null\*(''.
3200.PP
3201While these are two logically separate attributes (one line versus multi-line
3202insert mode, and special treatment of untyped spaces) we have seen no
3203terminals whose insert mode cannot be described with the single attribute.
3204.PP
3205Terminfo can describe both terminals which have an insert mode, and terminals
3206which send a simple sequence to open a blank position on the current line.
3207Give as \fBsmir\fP the sequence to get into insert mode.
3208Give as \fBrmir\fP the sequence to leave insert mode.
3209Now give as \fBich1\fP any sequence needed to be sent just before sending
3210the character to be inserted.
3211Most terminals with a true insert mode
3212will not give \fBich1\fP; terminals which send a sequence to open a screen
3213position should give it here.
3214.PP
3215If your terminal has both, insert mode is usually preferable to \fBich1\fP.
3216Technically, you should not give both unless the terminal actually requires
3217both to be used in combination.
3218Accordingly, some non-curses applications get
3219confused if both are present; the symptom is doubled characters in an update
3220using insert.
3221This requirement is now rare; most \fBich\fP sequences do not
3222require previous smir, and most smir insert modes do not require \fBich1\fP
3223before each character.
3224Therefore, the new \fBcurses\fP actually assumes this
3225is the case and uses either \fBrmir\fP/\fBsmir\fP or \fBich\fP/\fBich1\fP as
3226appropriate (but not both).
3227If you have to write an entry to be used under
3228new curses for a terminal old enough to need both, include the
3229\fBrmir\fP/\fBsmir\fP sequences in \fBich1\fP.
3230.PP
3231If post insert padding is needed, give this as a number of milliseconds
3232in \fBip\fP (a string option).
3233Any other sequence which may need to be
3234sent after an insert of a single character may also be given in \fBip\fP.
3235If your terminal needs both to be placed into an \*(``insert mode\*('' and
3236a special code to precede each inserted character, then both
3237.BR smir / rmir
3238and
3239.B ich1
3240can be given, and both will be used.
3241The
3242.B ich
3243capability, with one parameter,
3244.IR n ,
3245will repeat the effects of
3246.B ich1
3247.I n
3248times.
3249.PP
3250If padding is necessary between characters typed while not
3251in insert mode, give this as a number of milliseconds padding in \fBrmp\fP.
3252.PP
3253It is occasionally necessary to move around while in insert mode
3254to delete characters on the same line (e.g., if there is a tab after
3255the insertion position).
3256If your terminal allows motion while in
3257insert mode you can give the capability \fBmir\fP to speed up inserting
3258in this case.
3259Omitting \fBmir\fP will affect only speed.
3260Some terminals
3261(notably Datamedia's) must not have \fBmir\fP because of the way their
3262insert mode works.
3263.PP
3264Finally, you can specify
3265.B dch1
3266to delete a single character,
3267.B dch
3268with one parameter,
3269.IR n ,
3270to delete
3271.IR n "characters,"
3272and delete mode by giving \fBsmdc\fP and \fBrmdc\fP
3273to enter and exit delete mode (any mode the terminal needs to be placed
3274in for
3275.B dch1
3276to work).
3277.PP
3278A command to erase
3279.I n
3280characters (equivalent to outputting
3281.I n
3282blanks without moving the cursor)
3283can be given as
3284.B ech
3285with one parameter.
3286.SS "Highlighting, Underlining, and Visible Bells"
3287If your terminal has one or more kinds of display attributes,
3288these can be represented in a number of different ways.
3289You should choose one display form as
3290\f2standout mode\fP,
3291representing a good, high contrast, easy-on-the-eyes,
3292format for highlighting error messages and other attention getters.
3293(If you have a choice, reverse video plus half-bright is good,
3294or reverse video alone.)
3295The sequences to enter and exit standout mode
3296are given as \fBsmso\fP and \fBrmso\fP, respectively.
3297If the code to change into or out of standout
3298mode leaves one or even two blank spaces on the screen,
3299as the TVI 912 and Teleray 1061 do,
3300then \fBxmc\fP should be given to tell how many spaces are left.
3301.PP
3302Codes to begin underlining and end underlining can be given as \fBsmul\fP
3303and \fBrmul\fP respectively.
3304If the terminal has a code to underline the current character and move
3305the cursor one space to the right,
3306such as the Microterm Mime,
3307this can be given as \fBuc\fP.
3308.PP
3309Other capabilities to enter various highlighting modes include
3310.B blink
3311(blinking)
3312.B bold
3313(bold or extra bright)
3314.B dim
3315(dim or half-bright)
3316.B invis
3317(blanking or invisible text)
3318.B prot
3319(protected)
3320.B rev
3321(reverse video)
3322.B sgr0
3323(turn off
3324.I all
3325attribute modes)
3326.B smacs
3327(enter alternate character set mode)
3328and
3329.B rmacs
3330(exit alternate character set mode).
3331Turning on any of these modes singly may or may not turn off other modes.
3332.PP
3333If there is a sequence to set arbitrary combinations of modes,
3334this should be given as
3335.B sgr
3336(set attributes),
3337taking 9 parameters.
3338Each parameter is either zero (0) or nonzero,
3339as the corresponding attribute is on or off.
3340The 9 parameters are, in order:
3341standout, underline, reverse, blink, dim, bold, blank, protect, alternate
3342character set.
3343Not all modes need be supported by
3344.BR sgr ,
3345only those for which corresponding separate attribute commands exist.
3346.PP
3347For example, the DEC vt220 supports most of the modes:
3348.PP
3349.TS
3350center;
3351lb lb lb
3352l l l .
3353tparm Parameter Attribute Escape Sequence
3354_
3355none none \eE[0m
3356p1 standout \eE[0;1;7m
3357p2 underline \eE[0;4m
3358p3 reverse \eE[0;7m
3359p4 blink \eE[0;5m
3360p5 dim not available
3361p6 bold \eE[0;1m
3362p7 invis \eE[0;8m
3363p8 protect not used
3364p9 altcharset \*^O (off) \*^N (on)
3365.TE
3366.PP
3367We begin each escape sequence by turning off any existing modes, since
3368there is no quick way to determine whether they are active.
3369Standout is set up to be the combination of reverse and bold.
3370The vt220 terminal has a protect mode,
3371though it is not commonly used in sgr
3372because it protects characters on the screen from the host's erasures.
3373The altcharset mode also is different in that it is either \*^O or \*^N,
3374depending on whether it is off or on.
3375If all modes are turned on, the resulting sequence is \eE[0;1;4;5;7;8m\*^N.
3376.PP
3377Some sequences are common to different modes.
3378For example, ;7 is output when either p1 or p3 is true, that is, if
3379either standout or reverse modes are turned on.
3380.PP
3381Writing out the above sequences, along with their dependencies yields
3382.PP
3383.ne 11
3384.TS
3385center;
3386lb lb lb
3387l l l .
3388Sequence When to Output terminfo Translation
3389_
3390\eE[0 always \eE[0
3391;1 if p1 or p6 %?%p1%p6%|%t;1%;
3392;4 if p2 %?%p2%|%t;4%;
3393;5 if p4 %?%p4%|%t;5%;
3394;7 if p1 or p3 %?%p1%p3%|%t;7%;
3395;8 if p7 %?%p7%|%t;8%;
3396m always m
3397\*^N or \*^O if p9 \*^N, else \*^O %?%p9%t\*^N%e\*^O%;
3398.TE
3399.PP
3400Putting this all together into the sgr sequence gives:
3401.PP
3402.EX
3403 sgr=\eE[0%?%p1%p6%|%t;1%;%?%p2%t;4%;%?%p4%t;5%;
3404 %?%p1%p3%|%t;7%;%?%p7%t;8%;m%?%p9%t\e016%e\e017%;,
3405.EE
3406.PP
3407Remember that if you specify sgr, you must also specify sgr0.
3408Also, some implementations rely on sgr being given if sgr0 is,
3409Not all terminfo entries necessarily have an sgr string, however.
3410Many terminfo entries are derived from termcap entries
3411which have no sgr string.
3412The only drawback to adding an sgr string is that termcap also
3413assumes that sgr0 does not exit alternate character set mode.
3414.PP
3415Terminals with the \*(``magic cookie\*('' glitch
3416.RB ( xmc )
3417deposit special \*(``cookies\*('' when they receive mode-setting sequences,
3418which affect the display algorithm rather than having extra bits for
3419each character.
3420Some terminals, such as the HP 2621, automatically leave standout
3421mode when they move to a new line or the cursor is addressed.
3422Programs using standout mode should exit standout mode before
3423moving the cursor or sending a newline,
3424unless the
3425.B msgr
3426capability, asserting that it is safe to move in standout mode, is present.
3427.PP
3428If the terminal has
3429a way of flashing the screen to indicate an error quietly (a bell replacement)
3430then this can be given as \fBflash\fP; it must not move the cursor.
3431.PP
3432If the cursor needs to be made more visible than normal when it is
3433not on the bottom line (to make, for example, a non-blinking underline into an
3434easier to find block or blinking underline)
3435give this sequence as
3436.BR cvvis .
3437If there is a way to make the cursor completely invisible, give that as
3438.BR civis .
3439The capability
3440.B cnorm
3441should be given which undoes the effects of both of these modes.
3442.PP
3443If your terminal correctly generates underlined characters
3444(with no special codes needed)
3445even though it does not overstrike,
3446then you should give the capability \fBul\fP.
3447If a character overstriking another leaves both characters on the screen,
3448specify the capability \fBos\fP.
3449If overstrikes are erasable with a blank,
3450then this should be indicated by giving \fBeo\fP.
3451.SS "Keypad and Function Keys"
3452If the terminal has a keypad that transmits codes when the keys are pressed,
3453this information can be given.
3454Note that it is not possible to handle
3455terminals where the keypad only works in local (this applies, for example,
3456to the unshifted HP 2621 keys).
3457If the keypad can be set to transmit or not transmit,
3458give these codes as \fBsmkx\fP and \fBrmkx\fP.
3459Otherwise the keypad is assumed to always transmit.
3460.PP
3461The codes sent by the left arrow, right arrow, up arrow, down arrow,
3462and home keys can be given as
3463\fBkcub1, kcuf1, kcuu1, kcud1, \fRand\fB khome\fP respectively.
3464If there are function keys such as f0, f1, ..., f10, the codes they send
3465can be given as \fBkf0, kf1, ..., kf10\fP.
3466If these keys have labels other than the default f0 through f10, the labels
3467can be given as \fBlf0, lf1, ..., lf10\fP.
3468.PP
3469The codes transmitted by certain other special keys can be given:
3470.bP
3471.B kll
3472(home down),
3473.bP
3474.B kbs
3475(backspace),
3476.bP
3477.B ktbc
3478(clear all tabs),
3479.bP
3480.B kctab
3481(clear the tab stop in this column),
3482.bP
3483.B kclr
3484(clear screen or erase key),
3485.bP
3486.B kdch1
3487(delete character),
3488.bP
3489.B kdl1
3490(delete line),
3491.bP
3492.B krmir
3493(exit insert mode),
3494.bP
3495.B kel
3496(clear to end of line),
3497.bP
3498.B ked
3499(clear to end of screen),
3500.bP
3501.B kich1
3502(insert character or enter insert mode),
3503.bP
3504.B kil1
3505(insert line),
3506.bP
3507.B knp
3508(next page),
3509.bP
3510.B kpp
3511(previous page),
3512.bP
3513.B kind
3514(scroll forward/down),
3515.bP
3516.B kri
3517(scroll backward/up),
3518.bP
3519.B khts
3520(set a tab stop in this column).
3521.PP
3522In addition, if the keypad has a 3 by 3 array of keys including the four
3523arrow keys, the other five keys can be given as
3524.BR ka1 ,
3525.BR ka3 ,
3526.BR kb2 ,
3527.BR kc1 ,
3528and
3529.BR kc3 .
3530These keys are useful when the effects of a 3 by 3 directional pad are needed.
3531.PP
3532Strings to program function keys can be given as
3533.BR pfkey ,
3534.BR pfloc ,
3535and
3536.BR pfx .
3537A string to program screen labels should be specified as \fBpln\fP.
3538Each of these strings takes two parameters: the function key number to
3539program (from 0 to 10) and the string to program it with.
3540Function key numbers out of this range may program undefined keys in
3541a terminal dependent manner.
3542The difference between the capabilities is that
3543.B pfkey
3544causes pressing the given key to be the same as the user typing the
3545given string;
3546.B pfloc
3547causes the string to be executed by the terminal in local; and
3548.B pfx
3549causes the string to be transmitted to the computer.
3550.PP
3551The capabilities \fBnlab\fP, \fBlw\fP and \fBlh\fP
3552define the number of programmable
3553screen labels and their width and height.
3554If there are commands to turn the labels on and off,
3555give them in \fBsmln\fP and \fBrmln\fP.
3556\fBsmln\fP is normally output after one or more pln
3557sequences to make sure that the change becomes visible.
3558.SS "Tabs and Initialization"
3559A few capabilities are used only for tabs:
3560.bP
3561If the terminal has hardware tabs, the command to advance to the next
3562tab stop can be given as
3563.B ht
3564(usually control/I).
3565.bP
3566A \*(``back-tab\*('' command which moves leftward to the preceding tab stop can
3567be given as
3568.BR cbt .
3569.IP
3570By convention, if the teletype modes indicate that tabs are being
3571expanded by the computer rather than being sent to the terminal,
3572programs should not use
3573.B ht
3574or
3575.B cbt
3576even if they are present, since the user may not have the tab stops
3577properly set.
3578.bP
3579If the terminal has hardware tabs which are initially set every
3580.I n
3581spaces when the terminal is powered up,
3582the numeric parameter
3583.B it
3584is given, showing the number of spaces the tabs are set to.
3585.IP
3586The \fBit\fP capability is normally used by the \fB@TSET@\fP
3587command to determine whether to set the mode for hardware tab expansion,
3588and whether to set the tab stops.
3589If the terminal has tab stops that can be saved in non-volatile memory,
3590the terminfo description can assume that they are properly set.
3591.PP
3592Other capabilities
3593include
3594.bP
3595.BR is1 ,
3596.BR is2 ,
3597and
3598.BR is3 ,
3599initialization strings for the terminal,
3600.bP
3601.BR iprog ,
3602the path name of a program to be run to initialize the terminal,
3603.bP
3604and \fBif\fP, the name of a file containing long initialization strings.
3605.PP
3606These strings are expected to set the terminal into modes consistent
3607with the rest of the terminfo description.
3608They are normally sent to the terminal, by the
3609.I init
3610option of the \fB@TPUT@\fP program, each time the user logs in.
3611They will be printed in the following order:
3612.RS
3613.TP
3614run the program
3615.B iprog
3616.TP
3617output
3618.br
3619\fBis1\fP and
3620.br
3621\fBis2\fP
3622.TP
3623set the margins using
3624\fBmgc\fP or
3625.br
3626\fBsmglp\fP and \fBsmgrp\fP or
3627.br
3628\fBsmgl\fP and \fBsmgr\fP
3629.TP
3630set tabs using
3631.B tbc
3632and
3633.B hts
3634.TP
3635print the file
3636\fBif\fP
3637.TP
3638and finally output
3639\fBis3\fP.
3640.RE
3641.PP
3642Most initialization is done with
3643.BR is2 .
3644Special terminal modes can be set up without duplicating strings
3645by putting the common sequences in
3646.B is2
3647and special cases in
3648.B is1
3649and
3650.BR is3 .
3651.PP
3652A set of sequences that does a harder reset from a totally unknown state
3653can be given as
3654.BR rs1 ,
3655.BR rs2 ,
3656.B rf
3657and
3658.BR rs3 ,
3659analogous to
3660.B is1 ,
3661.B is2 ,
3662.B if
3663and
3664.B is3
3665respectively.
3666These strings are output
3667by \fIreset\fP option of \fB@TPUT@\fP,
3668or by the \fB@RESET@\fP program
3669(an alias of \fB@TSET@\fP),
3670which is used when the terminal gets into a wedged state.
3671Commands are normally placed in
3672.BR rs1 ,
3673.B rs2
3674.B rs3
3675and
3676.B rf
3677only if they produce annoying effects on the screen and are not
3678necessary when logging in.
3679For example, the command to set the vt100 into 80-column mode would
3680normally be part of
3681.BR is2 ,
3682but it causes an annoying glitch of the screen and is not normally
3683needed since the terminal is usually already in 80-column mode.
3684.PP
3685The \fB@RESET@\fP program writes strings including
3686.BR iprog ,
3687etc., in the same order as the
3688.I init
3689program, using
3690.BR rs1 ,
3691etc., instead of
3692.BR is1 ,
3693etc.
3694If any of
3695.BR rs1 ,
3696.BR rs2 ,
3697.BR rs3 ,
3698or
3699.B rf
3700reset capability strings are missing,
3701the \fB@RESET@\fP program
3702falls back upon the corresponding initialization capability string.
3703.PP
3704If there are commands to set and clear tab stops, they can be given as
3705.B tbc
3706(clear all tab stops)
3707and
3708.B hts
3709(set a tab stop in the current column of every row).
3710If a more complex sequence is needed to set the tabs than can be
3711described by this, the sequence can be placed in
3712.B is2
3713or
3714.BR if .
3715.PP
3716The \fB@TPUT@ reset\fP command uses the same capability strings
3717as the \fB@RESET@\fP command,
3718although the two programs (\fB@TPUT@\fP and \fB@RESET@\fP)
3719provide different command-line options.
3720.PP
3721In practice, these terminfo capabilities are not often used in
3722initialization of tabs
3723(though they are required for the \fB@TABS@\fP program):
3724.bP
3725Almost all hardware terminals (at least those which supported tabs)
3726initialized those to every \fIeight\fP columns:
3727.IP
3728The only exception was the AT&T 2300 series,
3729which set tabs to every \fIfive\fP columns.
3730.bP
3731In particular, developers of the hardware terminals which are commonly used
3732as models for modern terminal emulators provided documentation demonstrating
3733that \fIeight\fP columns were the standard.
3734.bP
3735Because of this, the terminal initialization programs
3736\fB@TPUT@\fP and \fB@TSET@\fP
3737use the
3738\fBtbc\fP (\fBclear_all_tabs\fP) and
3739\fBhts\fP (\fBset_tab\fP) capabilities directly
3740only when the \fBit\fP (\fBinit_tabs\fP) capability
3741is set to a value other than \fIeight\fP.
3742.SS "Delays and Padding"
3743Many older and slower terminals do not support either XON/XOFF or DTR
3744handshaking, including hard copy terminals and some very archaic CRTs
3745(including, for example, DEC VT100s).
3746These may require padding characters
3747after certain cursor motions and screen changes.
3748.PP
3749If the terminal uses xon/xoff handshaking for flow control (that is,
3750it automatically emits \*^S back to the host when its input buffers are
3751close to full), set
3752.BR xon .
3753This capability suppresses the emission of padding.
3754You can also set it
3755for memory-mapped console devices effectively that do not have a speed limit.
3756Padding information should still be included so that routines can
3757make better decisions about relative costs, but actual pad characters will
3758not be transmitted.
3759.PP
3760If \fBpb\fP (padding baud rate) is given, padding is suppressed at baud rates
3761below the value of \fBpb\fP.
3762If the entry has no padding baud rate, then
3763whether padding is emitted or not is completely controlled by \fBxon\fP.
3764.PP
3765If the terminal requires other than a null (zero) character as a pad,
3766then this can be given as \fBpad\fP.
3767Only the first character of the
3768.B pad
3769string is used.
3770.SS "Status Lines"
3771Some terminals have an extra \*(``status line\*('' which is not normally used by
3772software (and thus not counted in the terminal's \fBlines\fP capability).
3773.PP
3774The simplest case is a status line which is cursor-addressable but not
3775part of the main scrolling region on the screen; the Heathkit H19 has
3776a status line of this kind, as would a 24-line VT100 with a 23-line
3777scrolling region set up on initialization.
3778This situation is indicated
3779by the \fBhs\fP capability.
3780.PP
3781Some terminals with status lines need special sequences to access the
3782status line.
3783These may be expressed as a string with single parameter
3784\fBtsl\fP which takes the cursor to a given zero-origin column on the
3785status line.
3786The capability \fBfsl\fP must return to the main-screen
3787cursor positions before the last \fBtsl\fP.
3788You may need to embed the
3789string values of \fBsc\fP (save cursor) and \fBrc\fP (restore cursor)
3790in \fBtsl\fP and \fBfsl\fP to accomplish this.
3791.PP
3792The status line is normally assumed to be the same width as the width
3793of the terminal.
3794If this is untrue, you can specify it with the numeric
3795capability \fBwsl\fP.
3796.PP
3797A command to erase or blank the status line may be specified as \fBdsl\fP.
3798.PP
3799The Boolean capability \fBeslok\fP specifies that escape sequences, tabs,
3800etc., work ordinarily in the status line.
3801.PP
3802The \fI\%ncurses\fP implementation does not yet use any of these
3803capabilities.
3804They are documented here in case they ever become important.
3805.SS "Line Graphics"
3806Many terminals have alternate character sets useful for forms-drawing.
3807Terminfo and \fBcurses\fP have built-in support
3808for most of the drawing characters
3809supported by the VT100, with some characters from the AT&T 4410v1 added.
3810This alternate character set may be specified by the \fBacsc\fP capability.
3811.PP
3812.TS
3813center;
3814Lb Cb S L Lb
3815Lb2 Lb2 Lb Lb1 S
3816Lb L C Lb Lx.
3817\& acsc \& \&
3818ACS Name Value Symbol ASCII Fallback / Glyph Name
3819_
3820ACS_RARROW 0x2b + > arrow pointing right
3821ACS_LARROW 0x2c , < arrow pointing left
3822ACS_UARROW 0x2d \- \*^ arrow pointing up
3823ACS_DARROW 0x2e . v arrow pointing down
3824ACS_BLOCK 0x30 0 # solid square block
3825ACS_DIAMOND 0x60 \(ga + diamond
3826ACS_CKBOARD 0x61 a : checker board (stipple)
3827ACS_DEGREE 0x66 f \e degree symbol
3828ACS_PLMINUS 0x67 g # plus/minus
3829ACS_BOARD 0x68 h # board of squares
3830ACS_LANTERN 0x69 i # lantern symbol
3831ACS_LRCORNER 0x6a j + lower right corner
3832ACS_URCORNER 0x6b k + upper right corner
3833ACS_ULCORNER 0x6c l + upper left corner
3834ACS_LLCORNER 0x6d m + lower left corner
3835ACS_PLUS 0x6e n + large plus or crossover
3836ACS_S1 0x6f o \*~ scan line 1
3837ACS_S3 0x70 p \- scan line 3
3838ACS_HLINE 0x71 q \- horizontal line
3839ACS_S7 0x72 r \- scan line 7
3840ACS_S9 0x73 s \&_ scan line 9
3841ACS_LTEE 0x74 t + tee pointing right
3842ACS_RTEE 0x75 u + tee pointing left
3843ACS_BTEE 0x76 v + tee pointing up
3844ACS_TTEE 0x77 w + tee pointing down
3845ACS_VLINE 0x78 x | vertical line
3846ACS_LEQUAL 0x79 y < less-than-or-equal-to
3847ACS_GEQUAL 0x7a z > greater-than-or-equal-to
3848ACS_PI 0x7b { * greek pi
3849ACS_NEQUAL 0x7c | ! not-equal
3850ACS_STERLING 0x7d } f UK pound sign
3851ACS_BULLET 0x7e \*~ o bullet
3852.TE
3853.PP
3854A few notes apply to the table itself:
3855.bP
3856X/Open Curses incorrectly states that the mapping for \fIlantern\fP is
3857uppercase \*(``I\*('' although Unix implementations use the
3858lowercase \*(``i\*('' mapping.
3859.bP
3860The DEC VT100 implemented graphics using the alternate character set
3861feature, temporarily switching \fImodes\fP and sending characters
3862in the range 0x60 (96) to 0x7e (126)
3863(the \fBacsc Value\fP column in the table).
3864.bP
3865The AT&T terminal added graphics characters outside that range.
3866.IP
3867Some of the characters within the range do not match the VT100;
3868presumably they were used in the AT&T terminal:
3869\fIboard of squares\fP replaces the VT100 \fInewline\fP symbol, while
3870\fIlantern symbol\fP replaces the VT100 \fIvertical tab\fP symbol.
3871The other VT100 symbols for control characters (\fIhorizontal tab\fP,
3872\fIcarriage return\fP and \fIline-feed\fP) are not (re)used in curses.
3873.PP
3874The best way to define a new device's graphics set is to add a column
3875to a copy of this table for your terminal, giving the character which
3876(when emitted between \fBsmacs\fP/\fBrmacs\fP switches) will be rendered
3877as the corresponding graphic.
3878Then read off the VT100/your terminal
3879character pairs right to left in sequence; these become the ACSC string.
3880.SS "Color Handling"
3881The curses library functions \fBinit_pair\fP and \fBinit_color\fP
3882manipulate the \fIcolor pairs\fP and \fIcolor values\fP discussed in this
3883section
3884(see \fBcurs_color\fP(3X) for details on these and related functions).
3885.PP
3886Most color terminals are either \*(``Tektronix-like\*('' or \*(``HP-like\*('':
3887.bP
3888Tektronix-like
3889terminals have a predefined set of \fIN\fP colors
3890(where \fIN\fP is usually 8),
3891and can set
3892character-cell foreground and background characters independently, mixing them
3893into \fIN\fP\ *\ \fIN\fP color pairs.
3894.bP
3895On HP-like terminals, the user must set each color
3896pair up separately (foreground and background are not independently settable).
3897Up to \fIM\fP color pairs may be set up from 2*\fIM\fP different colors.
3898ANSI-compatible terminals are Tektronix-like.
3899.PP
3900Some basic color capabilities are independent of the color method.
3901The numeric
3902capabilities \fBcolors\fP and \fBpairs\fP specify the maximum numbers of colors
3903and color pairs that can be displayed simultaneously.
3904The \fBop\fP (original
3905pair) string resets foreground and background colors to their default values
3906for the terminal.
3907The \fBoc\fP string resets all colors or color pairs to
3908their default values for the terminal.
3909Some terminals (including many PC
3910terminal emulators) erase screen areas with the current background color rather
3911than the power-up default background; these should have the Boolean capability
3912\fBbce\fP.
3913.PP
3914While the curses library works with \fIcolor pairs\fP
3915(reflecting the inability of some devices to set foreground
3916and background colors independently),
3917there are separate capabilities for setting these features:
3918.bP
3919To change the current foreground or background color on a Tektronix-type
3920terminal, use \fBsetaf\fP (set ANSI foreground) and \fBsetab\fP (set ANSI
3921background) or \fBsetf\fP (set foreground) and \fBsetb\fP (set background).
3922These take one parameter, the color number.
3923The SVr4 documentation describes
3924only \fBsetaf\fP/\fBsetab\fP; the XPG4 draft says that "If the terminal
3925supports ANSI escape sequences to set background and foreground, they should
3926be coded as \fBsetaf\fP and \fBsetab\fP, respectively.
3927.bP
3928If the terminal
3929supports other escape sequences to set background and foreground, they should
3930be coded as \fBsetf\fP and \fBsetb\fP, respectively.
3931The \fBvidputs\fP and the \fBrefresh\fP(3X) functions
3932use the \fBsetaf\fP and \fBsetab\fP capabilities if they are defined.
3933.PP
3934The \fBsetaf\fP/\fBsetab\fP and \fBsetf\fP/\fBsetb\fP capabilities take a
3935single numeric argument each.
3936Argument values 0-7 of \fBsetaf\fP/\fBsetab\fP are portably defined as
3937follows (the middle column is the symbolic #define available in the header for
3938the \fBcurses\fP or \fI\%ncurses\fP libraries).
3939The terminal hardware is free to
3940map these as it likes, but the RGB values indicate normal locations in color
3941space.
3942.PP
3943.TS
3944center;
3945cb cb cb cb s s
3946l lb c l1 l1 l .
3947Color #define Value RGB
3948_
3949black COLOR_BLACK 0 0, 0, 0
3950red COLOR_RED 1 max, 0, 0
3951green COLOR_GREEN 2 0, max, 0
3952yellow COLOR_YELLOW 3 max, max, 0
3953blue COLOR_BLUE 4 0, 0, max
3954magenta COLOR_MAGENTA 5 max, 0, max
3955cyan COLOR_CYAN 6 0, max, max
3956white COLOR_WHITE 7 max, max, max
3957.TE
3958.br
3959.if t .ne 6v
3960.PP
3961The argument values of \fBsetf\fP/\fBsetb\fP historically correspond to
3962a different mapping, i.e.,
3963.PP
3964.TS
3965center;
3966cb cb cb cb s s
3967l lb c l1 l1 l .
3968Color #define Value RGB
3969_
3970black COLOR_BLACK 0 0, 0, 0
3971blue COLOR_BLUE 1 0, 0, max
3972green COLOR_GREEN 2 0, max, 0
3973cyan COLOR_CYAN 3 0, max, max
3974red COLOR_RED 4 max, 0, 0
3975magenta COLOR_MAGENTA 5 max, 0, max
3976yellow COLOR_YELLOW 6 max, max, 0
3977white COLOR_WHITE 7 max, max, max
3978.TE
3979.PP
3980It is important to not confuse the two sets of color capabilities;
3981otherwise red/blue will be interchanged on the display.
3982.PP
3983On an HP-like terminal, use \fBscp\fP with a color pair number parameter to set
3984which color pair is current.
3985.PP
3986Some terminals allow the \fIcolor values\fP to be modified:
3987.bP
3988On a Tektronix-like terminal, the capability \fBccc\fP may be present to
3989indicate that colors can be modified.
3990If so, the \fBinitc\fP capability will
3991take a color number (0 to \fBcolors\fP \- 1)and three more parameters which
3992describe the color.
3993These three parameters default to being interpreted as RGB
3994(Red, Green, Blue) values.
3995If the Boolean capability \fBhls\fP is present,
3996they are instead as HLS (Hue, Lightness, Saturation) indices.
3997The ranges are
3998terminal-dependent.
3999.bP
4000On an HP-like terminal, \fBinitp\fP may give a capability for changing a
4001color pair value.
4002It will take seven parameters; a color pair number (0 to
4003\fBmax_pairs\fP \- 1), and two triples describing first background and then
4004foreground colors.
4005These parameters must be (Red, Green, Blue) or
4006(Hue, Lightness, Saturation) depending on \fBhls\fP.
4007.PP
4008On some color terminals, colors collide with highlights.
4009You can register
4010these collisions with the \fBncv\fP capability.
4011This is a bit mask of
4012attributes not to be used when colors are enabled.
4013The correspondence with the
4014attributes understood by \fBcurses\fP is as follows:
4015.PP
4016.TS
4017center;
4018cb cb cb cb
4019lb n n lb.
4020Attribute Bit Decimal Set by
4021_
4022A_STANDOUT 0 1 sgr
4023A_UNDERLINE 1 2 sgr
4024A_REVERSE 2 4 sgr
4025A_BLINK 3 8 sgr
4026A_DIM 4 16 sgr
4027A_BOLD 5 32 sgr
4028A_INVIS 6 64 sgr
4029A_PROTECT 7 128 sgr
4030A_ALTCHARSET 8 256 sgr
4031A_HORIZONTAL 9 512 sgr1
4032A_LEFT 10 1024 sgr1
4033A_LOW 11 2048 sgr1
4034A_RIGHT 12 4096 sgr1
4035A_TOP 13 8192 sgr1
4036A_VERTICAL 14 16384 sgr1
4037A_ITALIC 15 32768 sitm
4038.TE
4039.PP
4040For example, on many IBM PC consoles, the underline attribute collides with the
4041foreground color blue and is not available in color mode.
4042These should have
4043an \fBncv\fP capability of 2.
4044.PP
4045SVr4 curses does nothing with \fBncv\fP,
4046\fI\%ncurses\fP recognizes it and optimizes
4047the output in favor of colors.
4048.SS Miscellaneous
4049If the terminal requires other than a null (zero) character as a pad, then this
4050can be given as pad.
4051Only the first character of the pad string is used.
4052If the terminal does not have a pad character, specify npc.
4053Note that \fI\%ncurses\fP implements the termcap-compatible \fBPC\fP
4054variable;
4055though the application may set this value to something other than
4056a null,
4057\fI\%ncurses\fP will test \fBnpc\fP first and use napms if the terminal
4058has no pad character.
4059.PP
4060If the terminal can move up or down half a line,
4061this can be indicated with
4062.B hu
4063(half-line up)
4064and
4065.B hd
4066(half-line down).
4067This is primarily useful for superscripts and subscripts on hard-copy terminals.
4068If a hard-copy terminal can eject to the next page (form feed), give this as
4069.B ff
4070(usually control/L).
4071.PP
4072If there is a command to repeat a given character a given number of
4073times (to save time transmitting a large number of identical characters)
4074this can be indicated with the parameterized string
4075.BR rep .
4076The first parameter is the character to be repeated and the second
4077is the number of times to repeat it.
4078Thus, tparm(repeat_char, \*'x\*', 10) is the same as \*(``xxxxxxxxxx\*(''.
4079.PP
4080If the terminal has a settable command character,
4081such as the \s-1TEKTRONIX\s+1 4025,
4082this can be indicated with
4083.BR cmdch .
4084A prototype command character is chosen which is used in all capabilities.
4085This character is given in the
4086.B cmdch
4087capability to identify it.
4088The following convention is supported on some Unix systems:
4089The environment is to be searched for a
4090.B CC
4091variable, and if found, all
4092occurrences of the prototype character are replaced with the character
4093in the environment variable.
4094.PP
4095Terminal descriptions that do not represent a specific kind of known
4096terminal, such as
4097.IR switch ,
4098.IR dialup ,
4099.IR patch ,
4100and
4101.IR network ,
4102should include the
4103.B gn
4104(generic) capability so that programs can complain that they do not know
4105how to talk to the terminal.
4106(This capability does not apply to
4107.I virtual
4108terminal descriptions for which the escape sequences are known.)
4109.PP
4110If the terminal has a \*(``meta key\*('' which acts as a shift key,
4111setting the 8th bit of any character transmitted, this fact can
4112be indicated with
4113.BR km .
4114Otherwise, software will assume that the 8th bit is parity and it
4115will usually be cleared.
4116If strings exist to turn this \*(``meta mode\*('' on and off, they
4117can be given as
4118.B smm
4119and
4120.BR rmm .
4121.PP
4122If the terminal has more lines of memory than will fit on the screen
4123at once, the number of lines of memory can be indicated with
4124.BR lm .
4125A value of
4126.BR lm #0
4127indicates that the number of lines is not fixed,
4128but that there is still more memory than fits on the screen.
4129.PP
4130If the terminal is one of those supported by the Unix virtual
4131terminal protocol, the terminal number can be given as
4132.BR vt .
4133.PP
4134Media copy
4135strings which control an auxiliary printer connected to the terminal
4136can be given as
4137.BR mc0 :
4138print the contents of the screen,
4139.BR mc4 :
4140turn off the printer, and
4141.BR mc5 :
4142turn on the printer.
4143When the printer is on, all text sent to the terminal will be sent
4144to the printer.
4145It is undefined whether the text is also displayed on the terminal screen
4146when the printer is on.
4147A variation
4148.B mc5p
4149takes one parameter, and leaves the printer on for as many characters
4150as the value of the parameter, then turns the printer off.
4151The parameter should not exceed 255.
4152All text, including
4153.BR mc4 ,
4154is transparently passed to the printer while an
4155.B mc5p
4156is in effect.
4157.SS "Glitches and Brain Damage"
4158Hazeltine terminals,
4159which do not allow \*(``\*~\*('' characters to be displayed should
4160indicate \fBhz\fP.
4161.PP
4162Terminals which ignore a line-feed immediately after an \fBam\fP wrap,
4163such as the Concept and vt100,
4164should indicate \fBxenl\fP.
4165.PP
4166If
4167.B el
4168is required to get rid of standout
4169(instead of merely writing normal text on top of it),
4170\fBxhp\fP should be given.
4171.PP
4172Teleray terminals, where tabs turn all characters moved over to blanks,
4173should indicate \fBxt\fP (destructive tabs).
4174Note: the variable indicating this is now \*(``dest_tabs_magic_smso\*(''; in
4175older versions, it was teleray_glitch.
4176This glitch is also taken to mean that it is not possible to position
4177the cursor on top of a \*(``magic cookie\*('',
4178that to erase standout mode it is instead necessary to use
4179delete and insert line.
4180The \fI\%ncurses\fP implementation ignores this glitch.
4181.PP
4182The Beehive Superbee, which is unable to correctly transmit the escape
4183or control/C characters, has
4184.BR xsb ,
4185indicating that the f1 key is used for escape and f2 for control/C.
4186(Only certain Superbees have this problem, depending on the ROM.)
4187Note that in older terminfo versions, this capability was called
4188\*(``beehive_glitch\*(''; it is now \*(``no_esc_ctl_c\*(''.
4189.PP
4190Other specific terminal problems may be corrected by adding more
4191capabilities of the form \fBx\fIx\fR.
4192.SS "Pitfalls of Long Entries"
4193Long terminfo entries are unlikely to be a problem; to date, no entry has even
4194approached terminfo's 4096-byte string-table maximum.
4195Unfortunately, the termcap
4196translations are much more strictly limited (to 1023 bytes),
4197thus termcap translations of long terminfo entries can cause problems.
4198.PP
4199The man pages for 4.3BSD
4200and older versions of \fBtgetent\fP instruct the user to
4201allocate a 1024-byte buffer for the termcap entry.
4202The entry gets null-terminated by
4203the termcap library, so that makes the maximum safe length for a termcap entry
42041k\-1 (1023) bytes.
4205Depending on what the application and the termcap library being used does,
4206and where in the termcap file the terminal type that \fBtgetent\fP
4207is searching for is, several bad things can happen:
4208.bP
4209some termcap libraries print a warning message,
4210.bP
4211some exit if they find an entry that's longer than 1023 bytes,
4212.bP
4213some neither exit nor warn, doing nothing useful, and
4214.bP
4215some simply truncate the entries to 1023 bytes.
4216.PP
4217Some application programs allocate more than
4218the recommended 1K for the termcap entry; others do not.
4219.PP
4220Each termcap entry has two important sizes associated with it: before
4221\*(``tc\*('' expansion, and after \*(``tc\*('' expansion.
4222\*(``tc\*('' is the capability that
4223tacks on another termcap entry to the end of the current one, to add
4224on its capabilities.
4225If a termcap entry does not use the \*(``tc\*(''
4226capability, then of course the two lengths are the same.
4227.PP
4228The \*(``before tc expansion\*('' length is the most important one, because it
4229affects more than just users of that particular terminal.
4230This is the
4231length of the entry as it exists in /etc/termcap, minus the
4232backslash-newline pairs, which \fBtgetent\fP strips out while reading it.
4233Some termcap libraries strip off the final newline, too (GNU termcap does not).
4234Now suppose:
4235.bP
4236a termcap entry before expansion is more than 1023 bytes long,
4237.bP
4238and the application has only allocated a 1k buffer,
4239.bP
4240and the termcap library (like the one in BSD/OS 1.1 and GNU) reads
4241the whole entry into the buffer, no matter what its length, to see
4242if it is the entry it wants,
4243.bP
4244and \fBtgetent\fP is searching for a terminal type that either is the
4245long entry, appears in the termcap file after the long entry, or
4246does not appear in the file at all (so that \fBtgetent\fP has to search
4247the whole termcap file).
4248.PP
4249Then \fBtgetent\fP will overwrite memory,
4250perhaps its stack,
4251and probably core dump the program.
4252Programs like telnet are particularly vulnerable; modern telnets
4253pass along values like the terminal type automatically.
4254The results are almost
4255as undesirable with a termcap library, like SunOS 4.1.3 and Ultrix 4.4, that
4256prints warning messages when it reads an overly long termcap entry.
4257If a
4258termcap library truncates long entries, like OSF/1 3.0, it is immune to dying
4259here but will return incorrect data for the terminal.
4260.PP
4261The \*(``after tc expansion\*('' length will have a similar effect to the
4262above, but only for people who actually set \fITERM\fP to that terminal
4263type, since \fBtgetent\fP only does \*(``tc\*('' expansion once it is found the
4264terminal type it was looking for, not while searching.
4265.PP
4266In summary, a termcap entry that is longer than 1023 bytes can cause,
4267on various combinations of termcap libraries and applications, a core
4268dump, warnings, or incorrect operation.
4269If it is too long even before
4270\*(``tc\*('' expansion, it will have this effect even for users of some other
4271terminal types and users whose \fITERM\fP variable does not have a termcap
4272entry.
4273.PP
4274When in \-C (translate to termcap) mode,
4275the \fI\%ncurses\fP implementation of
4276\fB@TIC@\fP(1M) issues warning messages when the pre-tc length of a termcap
4277translation is too long.
4278The \-c (check) option also checks resolved (after tc
4279expansion) lengths.
4280.SH FILES
4281.TP
4282.I \*d
4283compiled terminal description database directory
4284.SH EXTENSIONS
4285Searching for terminal descriptions in
4286\fI$HOME/.terminfo\fP and \fI\%TERMINFO_DIRS\fP
4287is not supported by older implementations.
4288.PP
4289Some SVr4 \fBcurses\fP implementations, and all previous to SVr4, do not
4290interpret the %A and %O operators in parameter strings.
4291.PP
4292SVr4/XPG4 do not specify whether \fBmsgr\fP licenses movement while in
4293an alternate-character-set mode (such modes may, among other things, map
4294CR and NL to characters that do not trigger local motions).
4295The \fI\%ncurses\fP implementation ignores \fBmsgr\fP in
4296\fBALTCHARSET\fP mode.
4297This raises the possibility that an XPG4
4298implementation making the opposite interpretation may need terminfo
4299entries made for \fI\%ncurses\fP to have \fBmsgr\fP turned off.
4300.PP
4301The \fI\%ncurses\fP library handles insert-character and
4302insert-character modes in a slightly non-standard way to get better
4303update efficiency.
4304See
4305the \fBInsert/Delete Character\fP subsection above.
4306.PP
4307The parameter substitutions for \fBset_clock\fP and \fBdisplay_clock\fP are
4308not documented in SVr4 or X/Open Curses.
4309They are deduced from the
4310documentation for the AT&T 505 terminal.
4311.PP
4312Be careful assigning the \fBkmous\fP capability.
4313The \fI\%ncurses\fP library wants to interpret it as \fBKEY_MOUSE\fP,
4314for use by terminals and emulators like xterm
4315that can return mouse-tracking information in the keyboard-input stream.
4316.PP
4317X/Open Curses does not mention italics.
4318Portable applications must assume that numeric capabilities are
4319signed 16-bit values.
4320This includes the \fIno_color_video\fP (\fBncv\fP) capability.
4321The 32768 mask value used for italics with \fBncv\fP can be confused with
4322an absent or cancelled \fBncv\fP.
4323If italics should work with colors,
4324then the \fBncv\fP value must be specified, even if it is zero.
4325.PP
4326Different commercial ports of \fI\%terminfo\fP and \fIcurses\fP support
4327different subsets of X/Open Curses and
4328(in some cases)
4329different extensions.
4330Here is a summary,
4331accurate as of October 1995,
4332after which the commercial Unix market contracted and lost diversity.
4333.bP
4334SVr4,
4335Solaris,
4336and \fI\%ncurses\fP support all SVr4 capabilities.
4337.bP
4338IRIX supports the SVr4 set and adds one undocumented extended string
4339capability (\fB\%set_pglen\fP).
4340.bP
4341SVr1 and Ultrix support a restricted subset of \fI\%terminfo\fP
4342capabilities.
4343The Booleans end with \fB\%xon_xoff\fP;
4344the numerics with \fB\%width_status_line\fP;
4345and the strings with \fB\%prtr_non\fP.
4346.bP
4347HP/UX supports the SVr1 subset,
4348plus the SVr[234] numerics
4349\fB\%num_labels\fP,
4350\fB\%label_height\fP,
4351\fB\%label_width\fP,
4352plus function keys 11 through 63,
4353plus
4354\fB\%plab_norm\fP,
4355\fB\%label_on\fP,
4356and
4357\fB\%label_off\fP,
4358plus a number of incompatible string table extensions.
4359.bP
4360AIX supports the SVr1 subset,
4361plus function keys 11 through 63,
4362plus a number of incompatible string table extensions.
4363.bP
4364OSF/1 supports both the SVr4 set and the AIX extensions.
4365.SH PORTABILITY
4366Do not count on compiled (binary) \fI\%terminfo\fP entries being
4367portable between commercial Unix systems.
4368At least two implementations of \fI\%terminfo\fP
4369(those of HP-UX and AIX)
4370diverged from those of other System V Unices after SVr1,
4371adding extension capabilities to the string table that
4372(in the binary format)
4373collide with subsequent System V and X/Open Curses extensions.
4374.SH AUTHORS
4375Zeyd M. Ben-Halim, Eric S. Raymond, Thomas E. Dickey.
4376Based on \fIpcurses\fP by Pavel Curtis.
4377.SH SEE ALSO
4378\fB\%@INFOCMP@\fP(1M),
4379\fB\%@TABS@\fP(1),
4380\fB\%@TIC@\fP(1M),
4381\fB\%curses\fP(3X),
4382\fB\%curs_color\fP(3X),
4383\fB\%curs_terminfo\fP(3X),
4384\fB\%curs_variables\fP(3X),
4385\fB\%printf\fP(3),
4386\fB\%term_variables\fP(3X),
4387\fB\%term\fP(5),
4388\fB\%user_caps\fP(5)