2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 1996, Sun Microsystems, Inc. All Rights Reserved.
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH TERMINFO 4 "April 9, 2016"
9 terminfo \- terminal and printer capability database
13 \fB/usr/share/lib/terminfo/?/*\fR
18 The \fBterminfo\fR database describes the capabilities of devices such as
19 terminals and printers. Devices are described in \fBterminfo\fR source files by
20 specifying a set of capabilities, by quantifying certain aspects of the device,
21 and by specifying character sequences that affect particular results. This
22 database is often used by screen oriented applications such as \fBvi\fR and
23 \fBcurses\fR-based programs, as well as by some system commands such as
24 \fBls\fR and \fBmore\fR. This usage allows them to work with a variety of
25 devices without changes to the programs.
28 \fBterminfo\fR descriptions are located in the directory pointed to by the
29 environment variable \fBTERMINFO\fR or in \fB/usr/share/lib/terminfo\fR.
30 \fBterminfo\fR descriptions are generated by \fBtic\fR(8).
33 \fBterminfo\fR source files consist of one or more device descriptions. Each
34 description consists of a header (beginning in column 1) and one or more lines
35 that list the features for that particular device. Every line in a
36 \fBterminfo\fR source file must end in a comma (\fB,\fR). Every line in a
37 \fBterminfo\fR source file except the header must be indented with one or more
38 white spaces (either spaces or tabs).
41 Entries in \fBterminfo\fR source files consist of a number of comma-separated
42 fields. White space after each comma is ignored. Embedded commas must be
43 escaped by using a backslash. Each device entry has the following format:
47 \fBalias\fR1 | \fBalias\fR2 | .\|.\|. | \fBalias\fRn | \fIfullname\fR,
48 capability1, \fIcapability\fR2,
59 The first line, commonly referred to as the header line, must begin in column
60 one and must contain at least two aliases separated by vertical bars. The last
61 field in the header line must be the long name of the device and it may
62 contain any string. Alias names must be unique in the \fBterminfo\fR database
63 and they must conform to system file naming conventions. See \fBtic\fR(8).
64 They cannot, for example, contain white space or slashes.
67 Every device must be assigned a name, such as "vt100". Device names (except the
68 long name) should be chosen using the following conventions. The name should
69 not contain hyphens because hyphens are reserved for use when adding suffixes
70 that indicate special modes.
73 These special modes may be modes that the hardware can be in, or user
74 preferences. To assign a special mode to a particular device, append a suffix
75 consisting of a hyphen and an indicator of the mode to the device name. For
76 example, the \fB-w\fR suffix means "wide mode". When specified, it allows for a
77 width of 132 columns instead of the standard 80 columns. Therefore, if you want
78 to use a "vt100" device set to wide mode, name the device "vt100-w". Use the
79 following suffixes where possible.
86 Suffix Meaning Example
87 \fB-w\fR Wide mode (more than 80 columns) \fB5410-w\fR
88 \fB-am\fR With auto. margins (usually default) \fBvt100-am\fR
89 \fB-nam\fR Without automatic margins \fBvt100-nam\fR
90 \fI-n\fR Number of lines on the screen \fB2300-40\fR
91 \fB-na\fR No arrow keys (leave them in local) \fBc100-na\fR
92 -\fIn\fRp Number of pages of memory \fBc100-4p\fR
93 \fB-rv\fR Reverse video \fB4415-rv\fR
98 The \fBterminfo\fR reference manual page is organized in two sections:
103 \fBPART 1: DEVICE CAPABILITIES\fR
109 \fBPART 2: PRINTER CAPABILITIES\fR
111 .SS "PART 1: DEVICE CAPABILITIES"
113 Capabilities in \fBterminfo\fR are of three types: Boolean capabilities (which
114 show that a device has or does not have a particular feature), numeric
115 capabilities (which quantify particular features of a device), and string
116 capabilities (which provide sequences that can be used to perform particular
117 operations on devices).
120 In the following table, a \fBVariable\fR is the name by which a \fBC\fR
121 programmer accesses a capability (at the \fBterminfo\fR level). A \fBCapname\fR
122 is the short name for a capability specified in the \fBterminfo\fR source file.
123 It is used by a person updating the source file and by the \fBtput\fR command.
124 A \fBTermcap Code\fR is a two-letter sequence that corresponds to the
125 \fBtermcap\fR capability name. (Note that \fBtermcap\fR is no longer
129 Capability names have no real length limit, but an informal limit of five
130 characters has been adopted to keep them short. Whenever possible, capability
131 names are chosen to be the same as or similar to those specified by the ANSI
132 X3.64-1979 standard. Semantics are also intended to match those of the ANSI
136 All string capabilities listed below may have padding specified, with the
137 exception of those used for input. Input capabilities, listed under the
138 \fBStrings\fR section in the following tables, have names beginning with
139 \fBkey_\fR. The \fB#i\fR symbol in the description field of the following
140 tables refers to the \fIi\fRth parameter.
144 ________________________________________________________________
146 Variable name Code Description
147 ________________________________________________________________
149 auto_left_margin bw bw cub1 wraps from column 0 to
151 auto_right_margin am am Terminal has automatic margins
152 back_color_erase bce be Screen erased with background
154 can_change ccc cc Terminal can re-define existing
156 ceol_standout_glitch xhp xs Standout not erased by
158 col_addr_glitch xhpa YA Only positive motion
160 cpi_changes_res cpix YF Changing character pitch
162 cr_cancels_micro_mode crxm YB Using cr turns off micro mode
163 dest_tabs_magic_smso xt xt Destructive tabs, magic
165 eat_newline_glitch xenl xn Newline ignored after
167 erase_overstrike eo eo Can erase overstrikes with a
169 generic_type gn gn Generic line type
170 (for example, dialup, switch)
171 hard_copy hc hc Hardcopy terminal
172 hard_cursor chts HC Cursor is hard to see
173 has_meta_key km km Has a meta key (shift,
175 has_print_wheel daisy YC Printer needs operator
176 to change character set
177 has_status_line hs hs Has extra "status line"
178 hue_lightness_saturation hls hl Terminal uses only HLS
179 color notation (Tektronix)
180 insert_null_glitch in in Insert mode distinguishes nulls
181 lpi_changes_res lpix YG Changing line pitch
183 memory_above da da Display may be retained
185 memory_below db db Display may be retained
187 move_insert_mode mir mi Safe to move while in insert
189 move_standout_mode msgr ms Safe to move in standout modes
190 needs_xon_xoff nxon nx Padding won't work,
192 no_esc_ctlc xsb xb Beehive (f1=escape, f2=ctrl C)
193 no_pad_char npc NP Pad character doesn't exist
194 non_dest_scroll_region ndscr ND Scrolling region
196 non_rev_rmcup nrrmc NR smcup does not reverse rmcup
197 over_strike os os Terminal overstrikes
198 on hard-copy terminal
199 prtr_silent mc5i 5i Printer won't echo on screen
200 row_addr_glitch xvpa YD Only positive motion
202 semi_auto_right_margin sam YE Printing in last column causes
204 status_line_esc_ok eslok es Escape can be used on
206 tilde_glitch hz hz Hazeltine; can't print tilde (~)
207 transparent_underline ul ul Underline character overstrikes
208 xon_xoff xon xo Terminal uses xon/xoff
217 ________________________________________________________________
219 Variable name Code Description
220 ________________________________________________________________
222 bit_image_entwining bitwin Yo Number of passes for each
224 bit_image_type bitype Yp Type of bit image device
225 buffer_capacity bufsz Ya Number of bytes buffered
227 buttons btns BT Number of buttons on the mouse
228 columns cols co Number of columns in a line
229 dot_horz_spacing spinh Yc Spacing of dots horizontally
231 dot_vert_spacing spinv Yb Spacing of pins vertically
233 init_tabs it it Tabs initially every # spaces
234 label_height lh lh Number of rows in each label
235 label_width lw lw Number of columns in each label
236 lines lines li Number of lines on a screen or
238 lines_of_memory lm lm Lines of memory if > lines;
240 max_attributes ma ma Maximum combined video attributes
242 magic_cookie_glitch xmc sg Number of blank characters
244 max_colors colors Co Maximum number of colors
246 max_micro_address maddr Yd Maximum value in
248 max_micro_jump mjump Ye Maximum value in parm_..._micro
249 max_pairs pairs pa Maximum number of
250 color-pairs on the screen
251 maximum_windows Wnum MW Maximum number of definable windows
252 micro_char_size mcs Yf Character step size when
254 micro_line_size mls Yg Line step size when in micro mode
255 no_color_video ncv NC Video attributes that
256 can't be used with colors
257 num_labels nlab Nl Number of labels on screen
258 number_of_pins npins Yh Number of pins in print-head
259 output_res_char orc Yi Horizontal resolution in
261 output_res_line orl Yj Vertical resolution in units per
263 output_res_horz_inch orhi Yk Horizontal resolution in
265 output_res_vert_inch orvi Yl Vertical resolution in
267 padding_baud_rate pb pb Lowest baud rate
268 print_rate cps Ym Print rate in characters per second
270 virtual_terminal vt vt Virtual terminal number (system)
271 wide_char_size widcs Yn Character step size when
273 width_status_line wsl ws Number of columns in status line
281 ________________________________________________________________
283 Variable name Code Description
284 ________________________________________________________________
286 acs_chars acsc ac Graphic charset pairs aAbBcC
287 alt_scancode_esc scesa S8 Alternate escape for
289 (default is for vt100)
290 back_tab cbt bt Back tab
291 bell bel bl Audible signal (bell)
292 bit_image_carriage_return bicr Yv Move to beginning of
294 bit_image_newline binel Zz Move to next row of
295 the bit image (use tparm)
296 bit_image_repeat birep Zy Repeat bit-image cell
297 #1 #2 times (use tparm)
298 carriage_return cr cr Carriage return
299 change_char_pitch cpi ZA Change number of
301 change_line_pitch lpi ZB Change number of lines per inch
302 change_res_horz chr ZC Change horizontal resolution
303 change_res_vert cvr ZD Change vertical resolution
304 change_scroll_region csr cs Change to lines #1
306 char_padding rmp rP Like ip but when in replace
308 char_set_names csnm Zy List of character set names
309 clear_all_tabs tbc ct Clear all tab stops
310 clear_margins mgc MC Clear all margins
311 (top, bottom, and sides)
312 clear_screen clear cl Clear screen and home cursor
313 clr_bol el1 cb Clear to beginning of
315 clr_eol el ce Clear to end of line
316 clr_eos ed cd Clear to end of display
317 code_set_init csin ci Init sequence
318 for multiple codesets
319 color_names colornm Yw Give name for color #1
320 column_address hpa ch Horizontal position
321 command_character cmdch CC Terminal settable cmd
322 character in prototype
323 create_window cwin CW Define win #1 to go
325 cursor_address cup cm Move to row #1 col #2
326 cursor_down cud1 do Down one line
327 cursor_home home ho Home cursor (if no cup)
328 cursor_invisible civis vi Make cursor invisible
329 cursor_left cub1 le Move left one space.
330 cursor_mem_address mrcup CM Memory relative cursor
332 cursor_normal cnorm ve Make cursor appear
334 cursor_right cuf1 nd Non-destructive space
335 (cursor or carriage right)
336 cursor_to_ll ll ll Last line, first
338 cursor_up cuu1 up Upline (cursor up)
339 cursor_visible cvvis vs Make cursor very visible
340 define_bit_image_region defbi Yx Define rectangular bit-
341 image region (use tparm)
342 define_char defc ZE Define a character in
344 delete_character dch1 dc Delete character
345 delete_line dl1 dl Delete line
346 device_type devt dv Indicate language/
348 dial_phone dial DI Dial phone number #1
349 dis_status_line dsl ds Disable status line
350 display_clock dclk DK Display time-of-day clock
351 display_pc_char dispc S1 Display PC character
352 down_half_line hd hd Half-line down (forward
354 ena_acs enacs eA Enable alternate character set
355 end_bit_image_region endbi Yy End a bit-image region
357 enter_alt_charset_mode smacs as Start alternate character set
358 enter_am_mode smam SA Turn on automatic margins
359 enter_blink_mode blink mb Turn on blinking
360 enter_bold_mode bold md Turn on bold (extra
362 enter_ca_mode smcup ti String to begin programs
364 enter_delete_mode smdc dm Delete mode (enter)
365 enter_dim_mode dim mh Turn on half-bright mode
366 enter_doublewide_mode swidm ZF Enable double wide printing
367 enter_draft_quality sdrfq ZG Set draft quality print mode
368 enter_insert_mode smir im Insert mode (enter)
369 enter_italics_mode sitm ZH Enable italics
370 enter_leftward_mode slm ZI Enable leftward carriage
372 enter_micro_mode smicm ZJ Enable micro motion
374 enter_near_letter_quality snlq ZK Set near-letter quality print
375 enter_normal_quality snrmq ZL Set normal quality
376 enter_pc_charset_mode smpch S2 Enter PC character display mode
377 enter_protected_mode prot mp Turn on protected mode
378 enter_reverse_mode rev mr Turn on reverse video mode
379 enter_scancode_mode smsc S4 Enter PC scancode mode
380 enter_scancode_mode smsc S4 Enter PC scancode mode
381 enter_secure_mode invis mk Turn on blank mode
382 (characters invisible)
383 enter_shadow_mode sshm ZM Enable shadow printing
384 enter_standout_mode smso so Begin standout mode
385 enter_subscript_mode ssubm ZN Enable subscript printing
386 enter_superscript_mode ssupm ZO Enable superscript printing
387 enter_underline_mode smul us Start underscore mode
388 enter_upward_mode sum ZP Enable upward carriage motion
390 enter_xon_mode smxon SX Turn on xon/xoff handshaking
391 erase_chars ech ec Erase #1 characters
392 exit_alt_charset_mode rmacs ae End alternate character set
393 exit_am_mode rmam RA Turn off automatic margins
394 exit_attribute_mode sgr0 me Turn off all attributes
395 exit_ca_mode rmcup te String to end programs
397 exit_delete_mode rmdc ed End delete mode
398 exit_doublewide_mode rwidm ZQ Disable double wide printing
399 exit_insert_mode rmir ei End insert mode
400 exit_italics_mode ritm ZR Disable italics
401 exit_leftward_mode rlm ZS Enable rightward (normal)
403 exit_micro_mode rmicm ZT Disable micro motion
405 exit_pc_charset_mode rmpch S3 Disable PC character
407 exit_scancode_mode rmsc S5 Disable PC scancode mode
408 exit_shadow_mode rshm ZU Disable shadow printing
409 exit_standout_mode rmso se End standout mode
410 exit_subscript_mode rsubm ZV Disable subscript printing
411 exit_superscript_mode rsupm ZW Disable superscript printing
412 exit_underline_mode rmul ue End underscore mode
413 exit_upward_mode rum ZX Enable downward (normal)
415 exit_xon_mode rmxon RX Turn off xon/xoff handshaking
416 fixed_pause pause PA Pause for 2-3 seconds
417 flash_hook hook fh Flash the switch hook
418 flash_screen flash vb Visible bell (may
420 form_feed ff ff Hardcopy terminal page eject
421 from_status_line fsl fs Return from status line
422 get_mouse getm Gm Curses should get button events
423 goto_window wingo WG Go to window #1
424 hangup hup HU Hang-up phone
425 init_1string is1 i1 Terminal or printer
426 initialization string
427 init_2string is2 is Terminal or printer
428 initialization string
429 init_3string is3 i3 Terminal or printer
430 initialization string
431 init_file if if Name of initialization file
432 init_prog iprog iP Path name of program
434 initialize_color initc Ic Initialize the
436 initialize_pair initp Ip Initialize color-pair
437 insert_character ich1 ic Insert character
438 insert_line il1 al Add new blank line
439 insert_padding ip ip Insert pad after
447 The ``\fBkey_\fR'' strings are sent by specific keys. The ``\fBkey_\fR''
448 descriptions include the macro, defined in \fB<curses.h>\fR, for the code
449 returned by the \fBcurses\fR routine \fBgetch\fR when the key is pressed (see
450 \fBcurs_getch\fR(3CURSES)).
454 ________________________________________________________________
456 Variable name Code Description
457 ________________________________________________________________
459 key_a1 ka1 K1 KEY_A1, upper left of keypad
460 key_a3 ka3 K3 KEY_A3, upper right of keypad
461 key_b2 kb2 K2 KEY_B2, center of keypad
462 key_backspace kbs kb KEY_BACKSPACE, sent by
464 key_beg kbeg @1 KEY_BEG, sent by beg(inning) key
465 key_btab kcbt kB KEY_BTAB, sent by back-tab key
466 key_c1 kc1 K4 KEY_C1, lower left of keypad
467 key_c3 kc3 K5 KEY_C3, lower right of keypad
468 key_cancel kcan @2 KEY_CANCEL, sent by cancel key
469 key_catab ktbc ka KEY_CATAB, sent by
471 key_clear kclr kC KEY_CLEAR, sent by
472 clear-screen or erase key
473 key_close kclo @3 KEY_CLOSE, sent by close key
474 key_command kcmd @4 KEY_COMMAND, sent by
476 key_copy kcpy @5 KEY_COPY, sent by copy key
477 key_create kcrt @6 KEY_CREATE, sent by create key
478 key_ctab kctab kt KEY_CTAB, sent by clear-tab key
479 key_dc kdch1 kD KEY_DC, sent by delete-character
481 key_dl kdl1 kL KEY_DL, sent by delete-line key
482 key_down kcud1 kd KEY_DOWN, sent by terminal
484 key_eic krmir kM KEY_EIC, sent by rmir or smir in
486 key_end kend @7 KEY_END, sent by end key
487 key_enter kent @8 KEY_ENTER, sent by enter/send
489 key_eol kel kE KEY_EOL, sent by
490 clear-to-end-of-line key
491 key_eos ked kS KEY_EOS, sent by
492 clear-to-end-of-screen key
493 key_exit kext @9 KEY_EXIT, sent by exit key
494 key_f0 kf0 k0 KEY_F(0), sent by function key f0
495 key_f1 kf1 k1 KEY_F(1), sent by function key f1
496 key_f2 kf2 k2 KEY_F(2), sent by function key f2
497 key_f3 kf3 k3 KEY_F(3), sent by function key f3
498 key_fB kf4 k4 KEY_F(4), sent by function key fB
499 key_f5 kf5 k5 KEY_F(5), sent by function key f5
500 key_f6 kf6 k6 KEY_F(6), sent by function key f6
501 key_f7 kf7 k7 KEY_F(7), sent by function key f7
502 key_f8 kf8 k8 KEY_F(8), sent by function key f8
503 key_f9 kf9 k9 KEY_F(9), sent by function key f9
505 key_f10 kf10 k; KEY_F(10), sent by function key
507 key_f11 kf11 F1 KEY_F(11), sent by function key
509 key_f12 kf12 F2 KEY_F(12), sent by function key
511 key_f13 kf13 F3 KEY_F(13), sent by function key
513 key_f14 kf14 F4 KEY_F(14), sent by function key
515 key_f15 kf15 F5 KEY_F(15), sent by function key
517 key_f16 kf16 F6 KEY_F(16), sent by function key
519 key_f17 kf17 F7 KEY_F(17), sent by function key
521 key_f18 kf18 F8 KEY_F(18), sent by function key
523 key_f19 kf19 F9 KEY_F(19), sent by function key
525 key_f20 kf20 FA KEY_F(20), sent by function key
527 key_f21 kf21 FB KEY_F(21), sent by function key
529 key_f22 kf22 FC KEY_F(22), sent by function key
531 key_f23 kf23 FD KEY_F(23), sent by function key
533 key_f24 kf24 FE KEY_F(24), sent by function key
535 key_f25 kf25 FF KEY_F(25), sent by function key
537 key_f26 kf26 FG KEY_F(26), sent by function key
539 key_f27 kf27 FH KEY_F(27), sent by function key
541 key_f28 kf28 FI KEY_F(28), sent by function key
543 key_f29 kf29 FJ KEY_F(29), sent by function key
545 key_f30 kf30 FK KEY_F(30), sent by function key
547 key_f31 kf31 FL KEY_F(31), sent by function key
549 key_f32 kf32 FM KEY_F(32), sent by function key
551 key_f33 kf33 FN KEY_F(13), sent by function key
553 key_f34 kf34 FO KEY_F(34), sent by function key
555 key_f35 kf35 FP KEY_F(35), sent by function key
557 key_f36 kf36 FQ KEY_F(36), sent by function key
559 key_f37 kf37 FR KEY_F(37), sent by function key
561 key_f38 kf38 FS KEY_F(38), sent by function key
563 key_f39 kf39 FT KEY_F(39), sent by function key
565 key_fB0 kf40 FU KEY_F(40), sent by function key
567 key_fB1 kf41 FV KEY_F(41), sent by function key
569 key_fB2 kf42 FW KEY_F(42), sent by function key
571 key_fB3 kf43 FX KEY_F(43), sent by function key
573 key_fB4 kf44 FY KEY_F(44), sent by function key
575 key_fB5 kf45 FZ KEY_F(45), sent by function key
577 key_fB6 kf46 Fa KEY_F(46), sent by function key
579 key_fB7 kf47 Fb KEY_F(47), sent by function key
581 key_fB8 kf48 Fc KEY_F(48), sent by function key
583 key_fB9 kf49 Fd KEY_F(49), sent by function key
585 key_f50 kf50 Fe KEY_F(50), sent by function key
587 key_f51 kf51 Ff KEY_F(51), sent by function key
589 key_f52 kf52 Fg KEY_F(52), sent by function key
591 key_f53 kf53 Fh KEY_F(53), sent by function key
593 key_f54 kf54 Fi KEY_F(54), sent by function key
595 key_f55 kf55 Fj KEY_F(55), sent by function key
597 key_f56 kf56 Fk KEY_F(56), sent by function key
599 key_f57 kf57 Fl KEY_F(57), sent by function key
601 key_f58 kf58 Fm KEY_F(58), sent by function key
603 key_f59 kf59 Fn KEY_F(59), sent by function key
605 key_f60 kf60 Fo KEY_F(60), sent by function key
607 key_f61 kf61 Fp KEY_F(61), sent by function key
609 key_f62 kf62 Fq KEY_F(62), sent by function key
611 key_f63 kf63 Fr KEY_F(63), sent by function key
613 key_find kfnd @0 KEY_FIND, sent by find key
614 key_help khlp %1 KEY_HELP, sent by help key
615 key_home khome kh KEY_HOME, sent by home key
616 key_ic kich1 kI KEY_IC, sent by ins-char/enter
618 key_il kil1 kA KEY_IL, sent by insert-line key
619 key_left kcub1 kl KEY_LEFT, sent by
620 terminal left-arrow key
621 key_ll kll kH KEY_LL, sent by home-down key
622 key_mark kmrk %2 KEY_MARK, sent by
623 key_message kmsg %3 KEY_MESSAGE, sent by message key
624 key_mouse kmous Km 0631, Mouse event has occurred
625 key_move kmov %4 KEY_MOVE, sent by move key
626 key_next knxt %5 KEY_NEXT, sent by next-object
628 key_npage knp kN KEY_NPAGE, sent by next-page
630 key_open kopn %6 KEY_OPEN, sent by open key
631 key_options kopt %7 KEY_OPTIONS, sent by options
633 key_ppage kpp kP KEY_PPAGE, sent by
635 key_previous kprv %8 KEY_PREVIOUS, sent by
637 key_print kprt %9 KEY_PRINT, sent by
639 key_redo krdo %0 KEY_REDO, sent by redo key
640 key_reference kref &1 KEY_REFERENCE, sent by
642 key_refresh krfr &2 KEY_REFRESH, sent by
644 key_replace krpl &3 KEY_REPLACE, sent by
646 key_restart krst &4 KEY_RESTART, sent by
648 key_resume kres &5 KEY_RESUME, sent by resume key
649 key_right kcuf1 kr KEY_RIGHT, sent by terminal
651 key_save ksav &6 KEY_SAVE, sent by save key
652 key_sbeg kBEG &9 KEY_SBEG, sent by
653 shifted beginning key
654 key_scancel kCAN &0 KEY_SCANCEL, sent by
656 key_scommand kCMD *1 KEY_SCOMMAND, sent by
658 key_scopy kCPY *2 KEY_SCOPY, sent by
660 key_screate kCRT *3 KEY_SCREATE, sent by
662 key_sdc kDC *4 KEY_SDC, sent by
663 shifted delete-char key
664 key_sdl kDL *5 KEY_SDL, sent by
665 shifted delete-line key
666 key_select kslt *6 KEY_SELECT, sent by
668 key_send kEND *7 KEY_SEND, sent by
670 key_seol kEOL *8 KEY_SEOL, sent by
671 shifted clear-line key
672 key_sexit kEXT *9 KEY_SEXIT, sent by
674 key_sf kind kF KEY_SF, sent by
675 scroll-forward/down key
676 key_sfind kFND *0 KEY_SFIND, sent by
678 key_shelp kHLP #1 KEY_SHELP, sent by
680 key_shome kHOM #2 KEY_SHOME, sent by
682 key_sic kIC #3 KEY_SIC, sent by
684 key_sleft kLFT #4 KEY_SLEFT, sent by
685 shifted left-arrow key
686 key_smessage kMSG %a KEY_SMESSAGE, sent by
688 key_smove kMOV %b KEY_SMOVE, sent by
690 key_snext kNXT %c KEY_SNEXT, sent by
692 key_soptions kOPT %d KEY_SOPTIONS, sent by
694 key_sprevious kPRV %e KEY_SPREVIOUS, sent by
696 key_sprint kPRT %f KEY_SPRINT, sent by
698 key_sr kri kR KEY_SR, sent by
699 scroll-backward/up key
700 key_sredo kRDO %g KEY_SREDO, sent by
702 key_sreplace kRPL %h KEY_SREPLACE, sent by
704 key_sright kRIT %i KEY_SRIGHT, sent by shifted
706 key_srsume kRES %j KEY_SRSUME, sent by
708 key_ssave kSAV !1 KEY_SSAVE, sent by
710 key_ssuspend kSPD !2 KEY_SSUSPEND, sent by
712 key_stab khts kT KEY_STAB, sent by
714 key_sundo kUND !3 KEY_SUNDO, sent by
716 key_suspend kspd &7 KEY_SUSPEND, sent by
718 key_undo kund &8 KEY_UNDO, sent by undo key
719 key_up kcuu1 ku KEY_UP, sent by
720 terminal up-arrow key
721 keypad_local rmkx ke Out of
722 ``keypad-transmit'' mode
723 keypad_xmit smkx ks Put terminal in
724 ``keypad-transmit'' mode
725 lab_f0 lf0 l0 Labels on function key
727 lab_f1 lf1 l1 Labels on function key
729 lab_f2 lf2 l2 Labels on function key
731 lab_f3 lf3 l3 Labels on function key
733 lab_fB lfB l4 Labels on function key
735 lab_f5 lf5 l5 Labels on function key
737 lab_f6 lf6 l6 Labels on function key
739 lab_f7 lf7 l7 Labels on function key
741 lab_f8 lf8 l8 Labels on function key
743 lab_f9 lf9 l9 Labels on function key
745 lab_f10 lf10 la Labels on function key
747 label_format fln Lf Label format
748 label_off rmln LF Turn off soft labels
749 label_on smln LO Turn on soft labels
750 meta_off rmm mo Turn off "meta mode"
751 meta_on smm mm Turn on "meta mode" (8th bit)
752 micro_column_address mhpa ZY Like column_address
754 micro_down mcud1 ZZ Like cursor_down
756 micro_left mcub1 Za Like cursor_left
758 micro_right mcuf1 Zb Like cursor_right
760 micro_row_address mvpa Zc Like row_address
762 micro_up mcuu1 Zd Like cursor_up
764 mouse_info minfo Mi Mouse status information
765 newline nel nw Newline (behaves like
767 order_of_pins porder Ze Matches software bits
769 orig_colors oc oc Set all color(-pair)s
771 orig_pair op op Set default color-pair
773 pad_char pad pc Pad character (rather than null)
774 parm_dch dch DC Delete #1 chars
775 parm_delete_line dl DL Delete #1 lines
776 parm_down_cursor cud DO Move down #1 lines
777 parm_down_micro mcud Zf Like parm_down_cursor
779 parm_ich ich IC Insert #1 blank chars
780 parm_index indn SF Scroll forward #1 lines
781 parm_insert_line il AL Add #1 new blank lines
782 parm_left_cursor cub LE Move cursor left #1 spaces
783 parm_left_micro mcub Zg Like parm_left_cursor
785 parm_right_cursor cuf RI Move right #1 spaces
786 parm_right_micro mcuf Zh Like parm_right_cursor
788 parm_rindex rin SR Scroll backward #1 lines
789 parm_up_cursor cuu UP Move cursor up #1 lines
790 parm_up_micro mcuu Zi Like parm_up_cursor
792 pc_term_options pctrm S6 PC terminal options
793 pkey_key pfkey pk Prog funct key #1 to
795 pkey_local pfloc pl Prog funct key #1 to
797 pkey_plab pfxl xl Prog key #1 to xmit
798 string #2 and show string #3
799 pkey_xmit pfx px Prog funct key #1 to
801 plab_norm pln pn Prog label #1 to show
803 print_screen mc0 ps Print contents of the screen
804 prtr_non mc5p pO Turn on the printer for #1 bytes
805 prtr_off mc4 pf Turn off the printer
806 prtr_on mc5 po Turn on the printer
807 pulse pulse PU Select pulse dialing
808 quick_dial qdial QD Dial phone number #1, without
810 remove_clock rmclk RC Remove time-of-day clock
811 repeat_char rep rp Repeat char #1 #2 times
812 req_for_input rfi RF Send next input char (for ptys)
813 req_mouse_pos reqmp RQ Request mouse position report
814 reset_1string rs1 r1 Reset terminal completely to
816 reset_2string rs2 r2 Reset terminal completely to
818 reset_3string rs3 r3 Reset terminal completely to
820 reset_file rf rf Name of file containing
822 restore_cursor rc rc Restore cursor to
824 row_address vpa cv Vertical position absolute
825 save_cursor sc sc Save cursor position
826 scancode_escape scesc S7 Escape for scancode emulation
827 scroll_forward ind sf Scroll text up
828 scroll_reverse ri sr Scroll text down
829 select_char_set scs Zj Select character set
830 set0_des_seq s0ds s0 Shift into codeset 0
832 set1_des_seq s1ds s1 Shift into codeset 1
833 set2_des_seq s2ds s2 Shift into codeset 2
834 set3_des_seq s3ds s3 Shift into codeset 3
836 set_a_background setab AB Set background color
838 set_a_foreground setaf AF Set foreground color
840 set_attributes sgr sa Define the video
842 set_background setb Sb Set current background color
843 set_bottom_margin smgb Zk Set bottom margin at
845 set_bottom_margin_parm smgbp Zl Set bottom margin at
848 set_clock sclk SC Set time-of-day clock
849 set_color_band setcolor YzChange to ribbon color #1
850 set_color_pair scp sp Set current color-pair
851 set_foreground setf Sf Set current foreground color1
852 set_left_margin smgl ML Set left margin at current line
853 set_left_margin_parm smglp Zm Set left (right) margin
855 set_lr_margin smglr ML Sets both left and right margins
856 set_page_length slines YZ Set page length to #1 lines
857 (use tparm) of an inch
858 set_right_margin smgr MR Set right margin at
860 set_right_margin_parm smgrp Zn Set right margin at column #1
861 set_tab hts st Set a tab in all rows,
863 set_tb_margin smgtb MT Sets both top and bottom margins
864 set_top_margin smgt Zo Set top margin at current line
865 set_top_margin_parm smgtp Zp Set top (bottom) margin
867 set_window wind wi Current window is lines
869 start_bit_image sbim Zq Start printing bit image graphics
870 start_char_set_def scsd Zr Start definition of a character
872 stop_bit_image rbim Zs End printing bit image graphics
873 stop_char_set_def rcsd Zt End definition of a character set
874 subscript_characters subcs Zu List of ``subscript-able''
876 superscript_characters supcs Zv List of ``superscript-able''
878 tab ht ta Tab to next 8-space hardware tab
880 these_cause_cr docr Zw Printing any of these
882 to_status_line tsl ts Go to status line, col #1
883 tone tone TO Select touch tone dialing
884 user0 u0 u0 User string 0
885 user1 u1 u1 User string 1
886 user2 u2 u2 User string 2
887 user3 u3 u3 User string 3
888 user4 u4 u4 User string 4
889 user5 u5 u5 User string 5
890 user6 u6 u6 User string 6
891 user7 u7 u7 User string 7
892 user8 u8 u8 User string 8
893 user9 u9 u9 User string 9
894 underline_char uc uc Underscore one char
896 up_half_line hu hu Half-line up (reverse
898 wait_tone wait WA Wait for dial tone
899 xoff_character xoffc XF X-off character
900 xon_character xonc XN X-on character
901 zero_motion zerom Zx No motion for the
909 The following entry, which describes the AT&T 610 terminal, is among the more
910 complex entries in the \fBterminfo\fR file as of this writing.
914 610|610bct|ATT610|att610|AT&T610;80column;98key keyboard
915 am, eslok, hs, mir, msgr, xenl, xon,
916 cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80,
917 acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
918 bel=^G, blink=\eE[5m, bold=\eE[1m, cbt=\eE[Z,
919 civis=\eE[?25l, clear=\eE[H\eE[J, cnorm=\eE[?25h\eE[?12l,
920 cr=\er, csr=\eE[%i%p1%d;%p2%dr, cub=\eE[%p1%dD, cub1=\eb,
921 cud=\eE[%p1%dB, cud1=\eE[B, cuf=\eE[%p1%dC, cuf1=\eE[C,
922 cup=\eE[%i%p1%d;%p2%dH, cuu=\eE[%p1%dA, cuu1=\eE[A,
923 cvvis=\eE[?12;25h, dch=\eE[%p1%dP, dch1=\eE[P, dim=\eE[2m,
924 dl=\eE[%p1%dM, dl1=\eE[M, ed=\eE[J, el=\eE[K, el1=\eE[1K,
925 flash=\eE[?5h$<200>\eE[?5l, fsl=\eE8, home=\eE[H, ht=\et,
926 ich=\eE[%p1%d@, il=\eE[%p1%dL, il1=\eE[L, ind=\eED, .ind=\eED$<9>,
928 is1=\eE[8;0 | \eE[?3;4;5;13;15l\eE[13;20l\eE[?7h\eE[12h\eE(B\eE)0,
929 is2=\eE[0m^O, is3=\eE(B\eE)0, kLFT=\eE[\es@, kRIT=\eE[\esA,
930 kbs=^H, kcbt=\eE[Z, kclr=\eE[2J, kcub1=\eE[D, kcud1=\eE[B,
931 kcuf1=\eE[C, kcuu1=\eE[A, kf1=\eEOc, kf10=\eENp,
932 kf11=\eENq, kf12=\eENr, kf13=\eENs, kf14=\eENt, kf2=\eEOd,
933 kf3=\eEOe, kf4=\eEOf, kf5=\eEOg, kf6=\eEOh, kf7=\eEOi,
934 kf8=\eEOj, kf9=\eENo, khome=\eE[H, kind=\eE[S, kri=\eE[T,
935 ll=\eE[24H, mc4=\eE[?4i, mc5=\eE[?5i, nel=\eEE,
936 pfxl=\eE[%p1%d;%p2%l%02dq%?%p1%{9}%<%t\es\es\esF%p1%1d\es\es\es\es\es
937 \es\es\es\es\es\es%%p2%s,
938 pln=\eE[%p1%d;0;0;0q%p2%:-16.16s, rc=\eE8, rev=\eE[7m,
939 ri=\eEM, rmacs=^O, rmir=\eE[4l, rmln=\eE[2p, rmso=\eE[m,
940 rmul=\eE[m, rs2=\eEc\eE[?3l, sc=\eE7,
941 sgr=\eE[0%?%p6%t;1%%?%p5%t;2%%?%p2%t;4%%?%p4%t;5%
942 %?%p3%p1% | %t;7%%?%p7%t;8%m%?%p9%t^N%e^O%,
943 sgr0=\eE[m^O, smacs=^N, smir=\eE[4h, smln=\eE[p,
944 smso=\eE[7m, smul=\eE[4m, tsl=\eE7\eE[25;%i%p1%dx,
948 .SS "Types of Capabilities in the Sample Entry"
950 The sample entry shows the formats for the three types of \fBterminfo\fR
951 capabilities listed: Boolean, numeric, and string. All capabilities specified
952 in the \fBterminfo\fR source file must be followed by commas, including the
953 last capability in the source file. In \fBterminfo\fR source files,
954 capabilities are referenced by their capability names (as shown in the previous
958 Boolean capabilities are specified simply by their comma separated cap names.
961 Numeric capabilities are followed by the character `#' and then a positive
962 integer value. Thus, in the sample, \fBcols\fR (which shows the number of
963 columns available on a device) is assigned the value \fB80\fR for the AT&T 610.
964 (Values for numeric capabilities may be specified in decimal, octal, or
965 hexadecimal, using normal C programming language conventions.)
968 Finally, string-valued capabilities such as \fBel\fR (clear to end of line
969 sequence) are listed by a two- to five-character capname, an `=', and a string
970 ended by the next occurrence of a comma. A delay in milliseconds may appear
971 anywhere in such a capability, preceded by \fB$\fR and enclosed in angle
972 brackets, as in \fBel=\eEK$<3>\fR. Padding characters are supplied by
973 \fBtput\fR. The delay can be any of the following: a number, a number followed
974 by an asterisk, such as \fB5*\fR, a number followed by a slash, such as
975 \fB5/\fR, or a number followed by both, such as \fB5*/\fR. A `\fB*\fR\fB\&'\fR
976 shows that the padding required is proportional to the number of lines affected
977 by the operation, and the amount given is the per-affected-unit padding
978 required. (In the case of insert characters, the factor is still the number of
979 lines affected. This is always 1 unless the device has \fBin\fR and the
980 software uses it.) When a `\fB*\fR\fB\&'\fR is specified, it is sometimes
981 useful to give a delay of the form \fB3.5\fR to specify a delay per unit to
982 tenths of milliseconds. (Only one decimal place is allowed.)
985 A `/' indicates that the padding is mandatory. If a device has \fBxon\fR
986 defined, the padding information is advisory and will only be used for cost
987 estimates or when the device is in raw mode. Mandatory padding will be
988 transmitted regardless of the setting of \fBxon\fR. If padding (whether
989 advisory or mandatory) is specified for \fBbel\fR or \fBflash\fR, however, it
990 will always be used, regardless of whether \fBxon\fR is specified.
993 \fBterminfo\fR offers notation for encoding special characters. Both \fB\eE\fR
994 and \fB\ee\fR map to an ESCAPE character, \fI^x\fR maps to a control \fIx\fR
995 for any appropriate \fIx\fR, and the sequences \fB\en, \el, \er, \et, \eb,
996 \ef\fR, and \fB\es\fR give a newline, linefeed, return, tab, backspace,
997 formfeed, and space, respectively. Other escapes include: \fB\e^\fR for caret
998 (^); \fB\e\e\fR for backslash (\e); \fB\e\fR, for comma (,); \fB\e:\fR for
999 colon (:); and \fB\e0\fR for null. (\fB\e0\fR will actually produce
1000 \fB\e200\fR, which does not terminate a string but behaves as a null character
1001 on most devices, providing CS7 is specified. (See \fBstty\fR(1)). Finally,
1002 characters may be given as three octal digits after a backslash (for example,
1006 Sometimes individual capabilities must be commented out. To do this, put a
1007 period before the capability name. For example, see the second \fBind\fR in the
1008 example above. Note that capabilities are defined in a left-to-right order and,
1009 therefore, a prior definition will override a later definition.
1010 .SS "Preparing Descriptions"
1012 The most effective way to prepare a device description is by imitating the
1013 description of a similar device in \fBterminfo\fR and building up a description
1014 gradually, using partial descriptions with \fBvi\fR to check that they are
1015 correct. Be aware that a very unusual device may expose deficiencies in the
1016 ability of the \fBterminfo\fR file to describe it or the inability of \fBvi\fR
1017 to work with that device. To test a new device description, set the environment
1018 variable \fBTERMINFO\fR to the pathname of a directory containing the compiled
1019 description you are working on and programs will look there rather than in
1020 \fB/usr/share/lib/terminfo\fR. To get the padding for insert-line correct (if
1021 the device manufacturer did not document it) a severe test is to comment out
1022 \fBxon\fR, edit a large file at 9600 baud with \fBvi\fR, delete 16 or so lines
1023 from the middle of the screen, and then press the \fBu\fR key several times
1024 quickly. If the display is corrupted, more padding is usually needed. A similar
1025 test can be used for insert-character.
1026 .SS "Section 1-1: Basic Capabilities"
1028 The number of columns on each line for the device is given by the \fBcols\fR
1029 numeric capability. If the device has a screen, then the number of lines on the
1030 screen is given by the \fBlines\fR capability. If the device wraps around to
1031 the beginning of the next line when it reaches the right margin, then it should
1032 have the \fBam\fR capability. If the terminal can clear its screen, leaving the
1033 cursor in the home position, then this is given by the \fBclear\fR string
1034 capability. If the terminal overstrikes (rather than clearing a position when a
1035 character is struck over) then it should have the \fBos\fR capability. If the
1036 device is a printing terminal, with no soft copy unit, specify both \fBhc\fR
1037 and \fBos\fR. If there is a way to move the cursor to the left edge of the
1038 current row, specify this as \fBcr\fR. (Normally this will be carriage return,
1039 control M.) If there is a way to produce an audible signal (such as a bell or a
1040 beep), specify it as \fBbel\fR. If, like most devices, the device uses the
1041 xon-xoff flow-control protocol, specify \fBxon\fR.
1044 If there is a way to move the cursor one position to the left (such as
1045 backspace), that capability should be given as \fBcub1\fR. Similarly, sequences
1046 to move to the right, up, and down should be given as \fBcuf1\fR, \fBcuu1\fR,
1047 and \fBcud1\fR, respectively. These local cursor motions must not alter the
1048 text they pass over; for example, you would not normally use ``\fBcuf1\fR=\es''
1049 because the space would erase the character moved over.
1052 A very important point here is that the local cursor motions encoded in
1053 \fBterminfo\fR are undefined at the left and top edges of a screen terminal.
1054 Programs should never attempt to backspace around the left edge, unless
1055 \fBbw\fR is specified, and should never attempt to go up locally off the top.
1056 To scroll text up, a program goes to the bottom left corner of the screen and
1057 sends the \fBind\fR (index) string.
1060 To scroll text down, a program goes to the top left corner of the screen and
1061 sends the \fBri\fR (reverse index) string. The strings \fBind\fR and \fBri\fR
1062 are undefined when not on their respective corners of the screen.
1065 Parameterized versions of the scrolling sequences are \fBindn\fR and \fBrin\fR.
1066 These versions have the same semantics as \fBind\fR and \fBri\fR, except that
1067 they take one parameter and scroll the number of lines specified by that
1068 parameter. They are also undefined except at the appropriate edge of the
1072 The \fBam\fR capability tells whether the cursor sticks at the right edge of
1073 the screen when text is output, but this does not necessarily apply to a
1074 \fBcuf1\fR from the last column. Backward motion from the left edge of the
1075 screen is possible only when \fBbw\fR is specified. In this case, \fBcub1\fR
1076 will move to the right edge of the previous row. If \fBbw\fR is not given, the
1077 effect is undefined. This is useful for drawing a box around the edge of the
1078 screen, for example. If the device has switch selectable automatic margins,
1079 \fBam\fR should be specified in the \fBterminfo\fR source file. In this case,
1080 initialization strings should turn on this option, if possible. If the device
1081 has a command that moves to the first column of the next line, that command can
1082 be given as \fBnel\fR (newline). It does not matter if the command clears the
1083 remainder of the current line, so if the device has no \fBcr\fR and \fBlf\fR it
1084 may still be possible to craft a working \fBnel\fR out of one or both of them.
1087 These capabilities suffice to describe hardcopy and screen terminals. Thus the
1088 AT&T 5320 hardcopy terminal is described as follows:
1092 5320|att5320|AT&T 5320 hardcopy terminal,
1095 bel=^G, cr=\er, cub1=\eb, cnd1=\en,
1096 dch1=\eE[P, dl1=\eE[M,
1104 while the Lear Siegler ADM\(mi3 is described as
1109 am, bel=^G, clear=^Z, cols#80, cr=^M, cub1=^H,
1110 cud1=^J, ind=^J, lines#24,
1115 .SS "Section 1-2: Parameterized Strings"
1117 Cursor addressing and other strings requiring parameters are described by a
1118 parameterized string capability, with \fBprintf\fR-like escapes
1119 (\fB%\fR\fIx\fR) in it. For example, to address the cursor, the \fBcup\fR
1120 capability is given, using two parameters: the row and column to address to.
1121 (Rows and columns are numbered from zero and refer to the physical screen
1122 visible to the user, not to any unseen memory.) If the terminal has memory
1123 relative cursor addressing, that can be indicated by \fBmrcup\fR.
1126 The parameter mechanism uses a stack and special \fB%\fR codes to manipulate
1127 the stack in the manner of Reverse Polish Notation (postfix). Typically a
1128 sequence will push one of the parameters onto the stack and then print it in
1129 some format. Often more complex operations are necessary. Operations are in
1130 postfix form with the operands in the usual order. That is, to subtract 5 from
1131 the first parameter, one would use \fB%p1%{5}%\(mi\fR.
1134 The \fB%\fR encodings have the following meanings:
1148 \fB\fB%[[:]\fR\fIflags\fR][\fIwidth\fR[\fI\&.precision\fR]][\fBdoxXs\fR]\fR
1152 as in \fBprintf\fR, flags are \fB[\(mi+#]\fR and space
1182 set dynamic variable [a-z] to pop
1192 get dynamic variable [a-z] and push it
1202 set static variable [a-z] to pop
1212 get static variable [a-z] and push it
1218 \fB\fB%'\fR\fIc\fR'\fR
1222 push char constant \fIc\fR
1228 \fB\fB%{\fR\fInn\fR}\fR
1232 push decimal constant \fInn\fR
1248 \fB\fB%+ %\(mi %* %/ %m\fR\fR
1252 arithmetic (\fB%m\fR is mod): push(pop integer2 op pop integer1)
1258 \fB\fB%& %| %^\fR\fR
1262 bit operations: push(pop integer2 op pop integer1)
1268 \fB\fB%= %> %<\fR\fR
1272 logical operations: push(pop integer2 op pop integer1)
1282 logical operations: and, or
1292 unary operations: push(op pop)
1302 (for ANSI terminals) add 1 to first parm, if one parm present, or first two
1303 parms, if more than one parm present
1309 \fB\fB%?\fR \fBexpr\fR %t \fIthenpart\fR %e \fIelsepart\fR %\fR
1313 if-then-else, \fB%e\fR \fIelsepart\fR is optional; else-if's are possible ala
1314 Algol 68: \fB%? c\fR(1) %t b(1) %e c(2) %t b(2) %e c(3) %t b(3) %e c(4) %t b(4)
1315 %e b(5)% c(\fIi\fR) are conditions, b(\fIi\fR) are bodies.
1320 If the ``\fB\(mi\fR\&'' flag is used with ``\fB%\fR[doxXs]'', then a colon
1321 (\fB:\fR) must be placed between the ``\fB%\fR'' and the ``\fB\(mi\fR\&'' to
1322 differentiate the flag from the binary ``\fB%\(mi\fR'' operator, for example
1323 ``\fB%:\(mi16.16s\fR''.
1326 Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs
1327 to be sent \fB\eE&a12c03Y\fR padded for 6 milliseconds. Note that the order of
1328 the rows and columns is inverted here, and that the row and column are
1329 zero-padded as two digits. Thus its \fBcup\fR capability is:
1330 \fBcup=\eE&a%p2%2.2dc%p1%2.2dY$<6>\fR
1333 The Micro-Term ACT-IV needs the current row and column sent preceded by a
1334 \fB^T\fR, with the row and column simply encoded in binary,
1335 ``\fBcup=^T%p1%c%p2%c\fR''. Devices that use ``\fB%c\fR'' need to be able to
1336 backspace the cursor (\fBcub1\fR), and to move the cursor up one line on the
1337 screen (\fBcuu1\fR). This is necessary because it is not always safe to
1338 transmit \fB\en\fR, \fB^D\fR, and \fB\er\fR, as the system may change or
1339 discard them. (The library routines dealing with \fBterminfo\fR set tty modes
1340 so that tabs are never expanded, so \fB\et\fR is safe to send. This turns out
1341 to be essential for the Ann Arbor 4080.)
1344 A final example is the LSI ADM-3a, which uses row and column offset by a blank
1345 character, thus ``\fBcup=\eE=%p1%'\es'%+%c%p2%'\es'%+%c\fR''. After sending
1346 ``\fB\eE=\fR\&'', this pushes the first parameter, pushes the ASCII value for a
1347 space (32), adds them (pushing the sum on the stack in place of the two
1348 previous values), and outputs that value as a character. Then the same is done
1349 for the second parameter. More complex arithmetic is possible using the stack.
1350 .SS "Section 1-3: Cursor Motions"
1352 If the terminal has a fast way to home the cursor (to very upper left corner of
1353 screen) then this can be given as \fBhome\fR; similarly a fast way of getting
1354 to the lower left-hand corner can be given as \fBll\fR; this may involve going
1355 up with \fBcuu1\fR from the home position, but a program should never do this
1356 itself (unless \fBll\fR does) because it can make no assumption about the
1357 effect of moving up from the home position. Note that the home position is the
1358 same as addressing to (0,0): to the top left corner of the screen, not of
1359 memory. (Thus, the \fB\eEH\fR sequence on Hewlett-Packard terminals cannot be
1360 used for \fBhome\fR without losing some of the other features on the terminal.)
1363 If the device has row or column absolute-cursor addressing, these can be given
1364 as single parameter capabilities \fBhpa\fR (horizontal position absolute) and
1365 \fBvpa\fR (vertical position absolute). Sometimes these are shorter than the
1366 more general two-parameter sequence (as with the Hewlett-Packard 2645) and can
1367 be used in preference to \fBcup\fR. If there are parameterized local motions
1368 (for example, move \fIn\fR spaces to the right) these can be given as
1369 \fBcud\fR, \fBcub\fR, \fBcuf\fR, and \fBcuu\fR with a single parameter
1370 indicating how many spaces to move. These are primarily useful if the device
1371 does not have \fBcup\fR, such as the Tektronix 4025.
1374 If the device needs to be in a special mode when running a program that uses
1375 these capabilities, the codes to enter and exit this mode can be given as
1376 \fBsmcup\fR and \fBrmcup\fR. This arises, for example, from terminals, such as
1377 the Concept, with more than one page of memory. If the device has only memory
1378 relative cursor addressing and not screen relative cursor addressing, a one
1379 screen-sized window must be fixed into the device for cursor addressing to work
1380 properly. This is also used for the Tektronix 4025, where \fBsmcup\fR sets the
1381 command character to be the one used by \fBterminfo\fR. If the \fBsmcup\fR
1382 sequence will not restore the screen after an \fBrmcup\fR sequence is output
1383 (to the state prior to outputting \fBrmcup\fR), specify \fBnrrmc\fR.
1384 .SS "Section 1-4: Area Clears"
1386 If the terminal can clear from the current position to the end of the line,
1387 leaving the cursor where it is, this should be given as \fBel\fR. If the
1388 terminal can clear from the beginning of the line to the current position
1389 inclusive, leaving the cursor where it is, this should be given as \fBel1\fR.
1390 If the terminal can clear from the current position to the end of the display,
1391 then this should be given as \fBed\fR. \fBed\fR is only defined from the first
1392 column of a line. (Thus, it can be simulated by a request to delete a large
1393 number of lines, if a true \fBed\fR is not available.)
1394 .SS "Section 1-5: Insert/Delete Line"
1396 If the terminal can open a new blank line before the line where the cursor is,
1397 this should be given as \fBil1\fR; this is done only from the first position of
1398 a line. The cursor must then appear on the newly blank line. If the terminal
1399 can delete the line which the cursor is on, then this should be given as
1400 \fBdl1\fR; this is done only from the first position on the line to be deleted.
1401 Versions of \fBil1\fR and \fBdl1\fR which take a single parameter and insert or
1402 delete that many lines can be given as \fBil\fR and \fBdl\fR.
1405 If the terminal has a settable destructive scrolling region (like the VT100)
1406 the command to set this can be described with the \fBcsr\fR capability, which
1407 takes two parameters: the top and bottom lines of the scrolling region. The
1408 cursor position is, alas, undefined after using this command. It is possible to
1409 get the effect of insert or delete line using this command \(em the \fBsc\fR
1410 and \fBrc\fR (save and restore cursor) commands are also useful. Inserting
1411 lines at the top or bottom of the screen can also be done using \fBri\fR or
1412 \fBind\fR on many terminals without a true insert/delete line, and is often
1413 faster even on terminals with those features.
1416 To determine whether a terminal has destructive scrolling regions or
1417 non-destructive scrolling regions, create a scrolling region in the middle of
1418 the screen, place data on the bottom line of the scrolling region, move the
1419 cursor to the top line of the scrolling region, and do a reverse index
1420 (\fBri\fR) followed by a delete line (\fBdl1\fR) or index (\fBind\fR). If the
1421 data that was originally on the bottom line of the scrolling region was
1422 restored into the scrolling region by the \fBdl1\fR or \fBind\fR, then the
1423 terminal has non-destructive scrolling regions. Otherwise, it has destructive
1424 scrolling regions. Do not specify \fBcsr\fR if the terminal has non-destructive
1425 scrolling regions, unless \fBind\fR, \fBri\fR, \fBindn\fR, \fBrin\fR, \fBdl\fR,
1426 and \fBdl1\fR all simulate destructive scrolling.
1429 If the terminal has the ability to define a window as part of memory, which all
1430 commands affect, it should be given as the parameterized string \fBwind\fR. The
1431 four parameters are the starting and ending lines in memory and the starting
1432 and ending columns in memory, in that order.
1435 If the terminal can retain display memory above, then the \fBda\fR capability
1436 should be given; if display memory can be retained below, then \fBdb\fR should
1437 be given. These indicate that deleting a line or scrolling a full screen may
1438 bring non-blank lines up from below or that scrolling back with \fBri\fR may
1439 bring down non-blank lines.
1440 .SS "Section 1-6: Insert/Delete Character"
1442 There are two basic kinds of intelligent terminals with respect to
1443 insert/delete character operations which can be described using \fBterminfo.\fR
1444 The most common insert/delete character operations affect only the characters
1445 on the current line and shift characters off the end of the line rigidly. Other
1446 terminals, such as the Concept 100 and the Perkin Elmer Owl, make a distinction
1447 between typed and untyped blanks on the screen, shifting upon an insert or
1448 delete only to an untyped blank on the screen which is either eliminated, or
1449 expanded to two untyped blanks. You can determine the kind of terminal you have
1450 by clearing the screen and then typing text separated by cursor motions. Type
1451 ``\fBabc def\fR'' using local cursor motions (not spaces) between the \fBabc\fR
1452 and the \fBdef\fR. Then position the cursor before the \fBabc\fR and put the
1453 terminal in insert mode. If typing characters causes the rest of the line to
1454 shift rigidly and characters to fall off the end, then your terminal does not
1455 distinguish between blanks and untyped positions. If the \fBabc\fR shifts over
1456 to the \fBdef\fR which then move together around the end of the current line
1457 and onto the next as you insert, you have the second type of terminal, and
1458 should give the capability \fBin\fR, which stands for ``insert null.'' While
1459 these are two logically separate attributes (one line versus multiline insert
1460 mode, and special treatment of untyped spaces) we have seen no terminals whose
1461 insert mode cannot be described with the single attribute.
1464 \fBterminfo\fR can describe both terminals that have an insert mode and
1465 terminals which send a simple sequence to open a blank position on the current
1466 line. Give as \fBsmir\fR the sequence to get into insert mode. Give as
1467 \fBrmir\fR the sequence to leave insert mode. Now give as \fBich1\fR any
1468 sequence needed to be sent just before sending the character to be inserted.
1469 Most terminals with a true insert mode will not give \fBich1\fR; terminals that
1470 send a sequence to open a screen position should give it here. (If your
1471 terminal has both, insert mode is usually preferable to \fBich1\fR. Do not give
1472 both unless the terminal actually requires both to be used in combination.) If
1473 post-insert padding is needed, give this as a number of milliseconds padding in
1474 \fBip\fR (a string option). Any other sequence which may need to be sent after
1475 an insert of a single character may also be given in \fBip\fR. If your terminal
1476 needs both to be placed into an `insert mode' and a special code to precede
1477 each inserted character, then both \fBsmir\fR/rmir and \fBich1\fR can be given,
1478 and both will be used. The \fBich\fR capability, with one parameter, \fIn\fR,
1479 will insert \fIn\fR blanks.
1482 If padding is necessary between characters typed while not in insert mode, give
1483 this as a number of milliseconds padding in \fBrmp\fR.
1486 It is occasionally necessary to move around while in insert mode to delete
1487 characters on the same line (for example, if there is a tab after the insertion
1488 position). If your terminal allows motion while in insert mode you can give the
1489 capability \fBmir\fR to speed up inserting in this case. Omitting \fBmir\fR
1490 will affect only speed. Some terminals (notably Datamedia's) must not have
1491 \fBmir\fR because of the way their insert mode works.
1494 Finally, you can specify \fBdch1\fR to delete a single character, \fBdch\fR
1495 with one parameter, \fIn\fR, to delete \fIn\fR characters, and delete mode by
1496 giving \fBsmdc\fR and \fBrmdc\fR to enter and exit delete mode (any mode the
1497 terminal needs to be placed in for \fBdch1\fR to work).
1500 A command to erase \fIn\fR characters (equivalent to outputting \fIn\fR blanks
1501 without moving the cursor) can be given as \fBech\fR with one parameter.
1502 .SS "Section 1-7: Highlighting, Underlining, and Visible Bells"
1504 Your device may have one or more kinds of display attributes that allow you to
1505 highlight selected characters when they appear on the screen. The following
1506 display modes (shown with the names by which they are set) may be available: a
1507 blinking screen (\fBblink\fR), bold or extra-bright characters (\fBbold\fR),
1508 dim or half-bright characters (\fBdim\fR), blanking or invisible text
1509 (\fBinvis\fR), protected text (\fBprot\fR), a reverse-video screen (\fBrev\fR),
1510 and an alternate character set (\fBsmacs\fR to enter this mode and \fBrmacs\fR
1511 to exit it). (If a command is necessary before you can enter alternate
1512 character set mode, give the sequence in \fBenacs\fR or "enable
1513 alternate-character-set" mode.) Turning on any of these modes singly may or may
1514 not turn off other modes.
1517 \fBsgr0\fR should be used to turn off all video enhancement capabilities. It
1518 should always be specified because it represents the only way to turn off some
1519 capabilities, such as \fBdim\fR or \fBblink\fR.
1522 You should choose one display method as \fIstandout mode\fR and use it to
1523 highlight error messages and other kinds of text to which you want to draw
1524 attention. Choose a form of display that provides strong contrast but that is
1525 easy on the eyes. (We recommend reverse-video plus half-bright or reverse-video
1526 alone.) The sequences to enter and exit standout mode are given as \fBsmso\fR
1527 and \fBrmso\fR, respectively. If the code to change into or out of standout
1528 mode leaves one or even two blank spaces on the screen, as the TVI 912 and
1529 Teleray 1061 do, then \fBxmc\fR should be given to tell how many spaces are
1533 Sequences to begin underlining and end underlining can be specified as
1534 \fBsmul\fR and \fBrmul ,\fR respectively. If the device has a sequence to
1535 underline the current character and to move the cursor one space to the right
1536 (such as the Micro-Term MIME), this sequence can be specified as \fBuc\fR.
1539 Terminals with the ``magic cookie'' glitch (\fBxmc\fR\fB)\fR deposit special
1540 ``cookies'' when they receive mode-setting sequences, which affect the display
1541 algorithm rather than having extra bits for each character. Some terminals,
1542 such as the Hewlett-Packard 2621, automatically leave standout mode when they
1543 move to a new line or the cursor is addressed. Programs using standout mode
1544 should exit standout mode before moving the cursor or sending a newline, unless
1545 the \fBmsgr\fR capability, asserting that it is safe to move in standout mode,
1549 If the terminal has a way of flashing the screen to indicate an error quietly
1550 (a bell replacement), then this can be given as \fBflash\fR; it must not move
1551 the cursor. A good flash can be done by changing the screen into reverse video,
1552 pad for 200 ms, then return the screen to normal video.
1555 If the cursor needs to be made more visible than normal when it is not on the
1556 bottom line (to make, for example, a non-blinking underline into an easier to
1557 find block or blinking underline) give this sequence as \fBcvvis\fR. The
1558 boolean \fBchts\fR should also be given. If there is a way to make the cursor
1559 completely invisible, give that as \fBcivis\fR. The capability \fBcnorm\fR
1560 should be given which undoes the effects of either of these modes.
1563 If your terminal generates underlined characters by using the underline
1564 character (with no special sequences needed) even though it does not otherwise
1565 overstrike characters, then you should specify the capability \fBul\fR. For
1566 devices on which a character overstriking another leaves both characters on the
1567 screen, specify the capability \fBos\fR. If overstrikes are erasable with a
1568 blank, then this should be indicated by specifying \fBeo\fR.
1571 If there is a sequence to set arbitrary combinations of modes, this should be
1572 given as \fBsgr\fR (set attributes), taking nine parameters. Each parameter is
1573 either \fB0\fR or non-zero, as the corresponding attribute is on or off. The
1574 nine parameters are, in order: standout, underline, reverse, blink, dim, bold,
1575 blank, protect, alternate character set. Not all modes need to be supported by
1576 \fBsgr\fR; only those for which corresponding separate attribute commands exist
1577 should be supported. For example, let's assume that the terminal in question
1578 needs the following escape sequences to turn on various modes.
1586 parameter attribute escape sequence
1589 p1 standout \eE[0;4;7m
1590 p2 underline \eE[0;3m
1596 p8 protect not available
1597 p9 altcharset ^O (off) ^N (on)
1602 Note that each escape sequence requires a \fB0\fR to turn off other modes
1603 before turning on its own mode. Also note that, as suggested above,
1604 \fIstandout\fR is set up to be the combination of \fIreverse\fR and \fIdim\fR.
1605 Also, because this terminal has no \fIbold\fR mode, \fIbold\fR is set up as the
1606 combination of \fIreverse\fR and \fIunderline\fR. In addition, to allow
1607 combinations, such as \fIunderline+blink\fR, the sequence to use would be
1608 \fB\eE[0;3;5m\fR\&. The terminal doesn't have \fIprotect\fR mode, either, but
1609 that cannot be simulated in any way, so \fBp8\fR is ignored. The
1610 \fIaltcharset\fR mode is different in that it is either \fB^O\fR or \fB^N\fR,
1611 depending on whether it is off or on. If all modes were to be turned on, the
1612 sequence would be \fB\eE[0;3;4;5;7;8m^N\fR\&.
1615 Now look at when different sequences are output. For example, \fB;3\fR is
1616 output when either \fBp2\fR or \fBp6\fR is true, that is, if either
1617 \fIunderline\fR or \fIbold\fR modes are turned on. Writing out the above
1618 sequences, along with their dependencies, gives the following:
1625 sequence when to output terminfo translation
1628 ;3 if \fBp2\fR or \fBp6\fR %?%p2%p6%|%t;3%
1629 ;4 if \fBp1\fR or \fBp3\fR or \fBp6\fR %?%p1%p3%|%p6%|%t;4%
1630 ;5 if \fBp4\fR %?%p4%t;5%
1631 ;7 if \fBp1\fR or \fBp5\fR %?%p1%p5%|%t;7%
1632 ;8 if \fBp7\fR %?%p7%t;8%
1634 ^N or ^O if \fBp9 ^N\fR, else \fB^O\fR %?%p9%t^N%e^O%
1639 Putting this all together into the \fBsgr\fR sequence gives:
1642 \fBsgr=\eE[0%?%p2%p6%|%t;3%%?%p1%p3%|%p6% |%t;4%%?%p5%t;5%%?%p1%p5%
1643 |%t;7%%?%p7%t;8%m%?%p9%t^N%e^O%,\fR
1646 Remember that \fBsgr\fR and \fBsgr0\fR must always be specified.
1647 .SS "Section 1-8: Keypad"
1649 If the device has a keypad that transmits sequences when the keys are pressed,
1650 this information can also be specified. Note that it is not possible to handle
1651 devices where the keypad only works in local (this applies, for example, to the
1652 unshifted Hewlett-Packard 2621 keys). If the keypad can be set to transmit or
1653 not transmit, specify these sequences as \fBsmkx\fR and \fBrmkx\fR. Otherwise
1654 the keypad is assumed to always transmit.
1657 The sequences sent by the left arrow, right arrow, up arrow, down arrow, and
1658 home keys can be given as \fBkcub1, kcuf1, kcuu1, kcud1,\fRand \fBkhome\fR,
1659 respectively. If there are function keys such as f0, f1, ..., f63, the
1660 sequences they send can be specified as \fBkf0, kf1, ..., kf63\fR. If the first
1661 11 keys have labels other than the default f0 through f10, the labels can be
1662 given as \fBlf0, lf1, ..., lf10\fR. The codes transmitted by certain other
1663 special keys can be given: \fBkll\fR (home down), \fBkbs\fR (backspace),
1664 \fBktbc\fR (clear all tabs), \fBkctab\fR (clear the tab stop in this column),
1665 \fBkclr\fR (clear screen or erase key), \fBkdch1\fR (delete character),
1666 \fBkdl1\fR (delete line), \fBkrmir\fR (exit insert mode), \fBkel\fR (clear to
1667 end of line), \fBked\fR (clear to end of screen), \fBkich1\fR (insert character
1668 or enter insert mode), \fBkil1\fR (insert line), \fBknp\fR (next page),
1669 \fBkpp\fR (previous page), \fBkind\fR (scroll forward/down), \fBkri\fR (scroll
1670 backward/up), \fBkhts\fR (set a tab stop in this column). In addition, if the
1671 keypad has a 3 by 3 array of keys including the four arrow keys, the other five
1672 keys can be given as \fBka1\fR, \fBka3\fR, \fBkb2\fR, \fBkc1\fR, and \fBkc3\fR.
1673 These keys are useful when the effects of a 3 by 3 directional pad are needed.
1674 Further keys are defined above in the capabilities list.
1677 Strings to program function keys can be specified as \fBpfkey\fR, \fBpfloc\fR,
1678 and \fBpfx\fR. A string to program screen labels should be specified as
1679 \fBpln\fR. Each of these strings takes two parameters: a function key
1680 identifier and a string to program it with. \fBpfkey\fR causes pressing the
1681 given key to be the same as the user typing the given string; \fBpfloc\fR
1682 causes the string to be executed by the terminal in local mode; and \fBpfx\fR
1683 causes the string to be transmitted to the computer. The capabilities
1684 \fBnlab\fR, \fBlw\fR and \fBlh\fR define the number of programmable screen
1685 labels and their width and height. If there are commands to turn the labels on
1686 and off, give them in \fBsmln\fR and \fBrmln\fR. \fBsmln\fR is normally output
1687 after one or more \fBpln\fR sequences to make sure that the change becomes
1689 .SS "Section 1-9: Tabs and Initialization"
1691 If the device has hardware tabs, the command to advance to the next tab stop
1692 can be given as \fBht\fR (usually control I). A ``backtab'' command that moves
1693 leftward to the next tab stop can be given as \fBcbt\fR. By convention, if tty
1694 modes show that tabs are being expanded by the computer rather than being sent
1695 to the device, programs should not use \fBht\fR or \fBcbt\fR (even if they are
1696 present) because the user may not have the tab stops properly set. If the
1697 device has hardware tabs that are initially set every \fIn\fR spaces when the
1698 device is powered up, the numeric parameter \fBit\fR is given, showing the
1699 number of spaces the tabs are set to. This is normally used by \fBtput\fR
1700 \fBinit\fR (see \fBtput\fR(1)) to determine whether to set the mode for
1701 hardware tab expansion and whether to set the tab stops. If the device has tab
1702 stops that can be saved in nonvolatile memory, the \fBterminfo\fR description
1703 can assume that they are properly set. If there are commands to set and clear
1704 tab stops, they can be given as \fBtbc\fR (clear all tab stops) and \fBhts\fR
1705 (set a tab stop in the current column of every row).
1708 Other capabilities include: \fBis1\fR, \fBis2\fR, and \fBis3\fR, initialization
1709 strings for the device; \fBiprog\fR, the path name of a program to be run to
1710 initialize the device; and \fBif\fR, the name of a file containing long
1711 initialization strings. These strings are expected to set the device into modes
1712 consistent with the rest of the \fBterminfo\fR description. They must be sent
1713 to the device each time the user logs in and be output in the following order:
1714 run the program \fBiprog\fR; output \fBis1\fR; output \fBis2\fR; set the
1715 margins using \fBmgc\fR, \fBsmgl\fR and \fBsmgr\fR; set the tabs using
1716 \fBtbc\fR and \fBhts\fR; print the file \fBif\fR; and finally output \fBis3\fR.
1717 This is usually done using the \fBinit\fR option of \fBtput\fR.
1720 Most initialization is done with \fBis2\fR. Special device modes can be set up
1721 without duplicating strings by putting the common sequences in \fBis2\fR and
1722 special cases in \fBis1\fR and \fBis3\fR. Sequences that do a reset from a
1723 totally unknown state can be given as \fBrs1\fR, \fBrs2\fR, \fBrf\fR, and
1724 \fBrs3\fR, analogous to \fBis1\fR, \fBis2\fR, \fBis3\fR, and \fBif\fR. (The
1725 method using files, \fBif\fR and \fBrf\fR, is used for a few terminals, from
1726 \fB/usr/share/lib/tabset/*\fR; however, the recommended method is to use the
1727 initialization and reset strings.) These strings are output by \fBtput\fR
1728 reset, which is used when the terminal gets into a wedged state. Commands are
1729 normally placed in \fBrs1\fR, \fBrs2\fR, \fBrs3\fR, and \fBrf\fR only if they
1730 produce annoying effects on the screen and are not necessary when logging in.
1731 For example, the command to set a terminal into 80-column mode would normally
1732 be part of \fBis2\fR, but on some terminals it causes an annoying glitch on the
1733 screen and is not normally needed because the terminal is usually already in
1737 If a more complex sequence is needed to set the tabs than can be described by
1738 using \fBtbc\fR and \fBhts\fR, the sequence can be placed in \fBis2\fR or
1742 Any margin can be cleared with \fBmgc\fR. (For instructions on how to specify
1743 commands to set and clear margins, see "Margins" below under "PRINTER
1745 .SS "Section 1-10: Delays"
1747 Certain capabilities control padding in the \fBtty\fR driver. These are
1748 primarily needed by hard-copy terminals, and are used by \fBtput\fR \fBinit\fR
1749 to set tty modes appropriately. Delays embedded in the capabilities \fBcr\fR,
1750 \fBind\fR, \fBcub1\fR, \fBff\fR, and \fBtab\fR can be used to set the
1751 appropriate delay bits to be set in the tty driver. If \fBpb\fR (padding baud
1752 rate) is given, these values can be ignored at baud rates below the value of
1754 .SS "Section 1-11: Status Lines"
1756 If the terminal has an extra ``status line'' that is not normally used by
1757 software, this fact can be indicated. If the status line is viewed as an extra
1758 line below the bottom line, into which one can cursor address normally (such as
1759 the Heathkit h19's 25th line, or the 24th line of a VT100 which is set to a
1760 23-line scrolling region), the capability \fBhs\fR should be given. Special
1761 strings that go to a given column of the status line and return from the status
1762 line can be given as \fBtsl\fR and \fBfsl\fR. (\fBfsl\fR must leave the cursor
1763 position in the same place it was before \fBtsl\fR. If necessary, the \fBsc\fR
1764 and \fBrc\fR strings can be included in \fBtsl\fR and \fBfsl\fR to get this
1765 effect.) The capability \fBtsl\fR takes one parameter, which is the column
1766 number of the status line the cursor is to be moved to.
1769 If escape sequences and other special commands, such as tab, work while in the
1770 status line, the flag \fBeslok\fR can be given. A string which turns off the
1771 status line (or otherwise erases its contents) should be given as \fBdsl\fR. If
1772 the terminal has commands to save and restore the position of the cursor, give
1773 them as \fBsc\fR and \fBrc\fR. The status line is normally assumed to be the
1774 same width as the rest of the screen, for example, \fBcols\fR. If the status
1775 line is a different width (possibly because the terminal does not allow an
1776 entire line to be loaded) the width, in columns, can be indicated with the
1777 numeric parameter \fBwsl\fR.
1778 .SS "Section 1-12: Line Graphics"
1780 If the device has a line drawing alternate character set, the mapping of glyph
1781 to character would be given in \fBacsc\fR. The definition of this string is
1782 based on the alternate character set used in the DEC VT100 terminal, extended
1783 slightly with some characters from the AT&T 4410v1 terminal.
1790 Glyph Name vt100+ Character
1792 arrow pointing right +
1793 arrow pointing left ,
1794 arrow pointing down \&.
1795 solid square block 0
1797 arrow pointing up \(mi
1799 checker board (stipple) a
1803 lower right corner j
1804 upper right corner k
1821 The best way to describe a new device's line graphics set is to add a third
1822 column to the above table with the characters for the new device that produce
1823 the appropriate glyph when the device is in the alternate character set mode.
1831 Glyph Name vt100+ Char New tty Char
1833 upper left corner l R
1834 lower left corner m F
1835 upper right corner k T
1836 lower right corner j G
1843 Now write down the characters left to right, as in
1844 ``\fBacsc=lRmFkTjGq\e,x.\fR''.
1847 In addition, \fBterminfo\fR allows you to define multiple character sets. See
1848 Section 2-5 for details.
1849 .SS "Section 1-13: Color Manipulation"
1851 Let us define two methods of color manipulation: the Tektronix method and the
1852 HP method. The Tektronix method uses a set of N predefined colors (usually 8)
1853 from which a user can select "current" foreground and background colors. Thus a
1854 terminal can support up to N colors mixed into N*N color-pairs to be displayed
1855 on the screen at the same time. When using an HP method the user cannot define
1856 the foreground independently of the background, or vice-versa. Instead, the
1857 user must define an entire color-pair at once. Up to M color-pairs, made from
1858 2*M different colors, can be defined this way. Most existing color terminals
1859 belong to one of these two classes of terminals.
1862 The numeric variables \fBcolors\fR and \fBpairs\fR define the number of colors
1863 and color-pairs that can be displayed on the screen at the same time. If a
1864 terminal can change the definition of a color (for example, the Tektronix 4100
1865 and 4200 series terminals), this should be specified with \fBccc\fR (can change
1866 color). To change the definition of a color (Tektronix 4200 method), use
1867 \fBinitc\fR (initialize color). It requires four arguments: color number
1868 (ranging from 0 to \fBcolors\fR\(mi1) and three RGB (red, green, and blue)
1869 values or three HLS colors (Hue, Lightness, Saturation). Ranges of RGB and HLS
1870 values are terminal dependent.
1873 Tektronix 4100 series terminals only use HLS color notation. For such terminals
1874 (or dual-mode terminals to be operated in HLS mode) one must define a boolean
1875 variable \fBhls\fR; that would instruct the \fBcurses init_color\fR routine to
1876 convert its RGB arguments to HLS before sending them to the terminal. The last
1877 three arguments to the \fBinitc\fR string would then be HLS values.
1880 If a terminal can change the definitions of colors, but uses a color notation
1881 different from RGB and HLS, a mapping to either RGB or HLS must be developed.
1884 To set current foreground or background to a given color, use \fBsetaf\fR (set
1885 ANSI foreground) and \fBsetab\fR (set ANSI background). They require one
1886 parameter: the number of the color. To initialize a color-pair (HP method),
1887 use \fBinitp\fR (initialize pair). It requires seven parameters: the number of
1888 a color-pair (range=0 to \fBpairs\fR\(mi1), and six RGB values: three for the
1889 foreground followed by three for the background. (Each of these groups of three
1890 should be in the order RGB.) When \fBinitc\fR or \fBinitp\fR are used, RGB or
1891 HLS arguments should be in the order "red, green, blue" or "hue, lightness,
1892 saturation"), respectively. To make a color-pair current, use \fBscp\fR (set
1893 color-pair). It takes one parameter, the number of a color-pair.
1896 Some terminals (for example, most color terminal emulators for PCs) erase areas
1897 of the screen with current background color. In such cases, \fBbce\fR
1898 (background color erase) should be defined. The variable \fBop\fR (original
1899 pair) contains a sequence for setting the foreground and the background colors
1900 to what they were at the terminal start-up time. Similarly, \fBoc\fR (original
1901 colors) contains a control sequence for setting all colors (for the Tektronix
1902 method) or color-pairs (for the HP method) to the values they had at the
1903 terminal start-up time.
1906 Some color terminals substitute color for video attributes. Such video
1907 attributes should not be combined with colors. Information about these video
1908 attributes should be packed into the \fBncv\fR (no color video) variable. There
1909 is a one-to-one correspondence between the nine least significant bits of that
1910 variable and the video attributes. The following table depicts this
1918 Attribute Bit Position Decimal Value
1933 When a particular video attribute should not be used with colors, the
1934 corresponding \fBncv\fR bit should be set to 1; otherwise it should be set to
1935 zero. To determine the information to pack into the \fBncv\fR variable, you
1936 must add together the decimal values corresponding to those attributes that
1937 cannot coexist with colors. For example, if the terminal uses colors to
1938 simulate reverse video (bit number 2 and decimal value 4) and bold (bit number
1939 5 and decimal value 32), the resulting value for \fBncv\fR will be 36 (4 + 32).
1940 .SS "Section 1-14: Miscellaneous"
1942 If the terminal requires other than a null (zero) character as a pad, then this
1943 can be given as \fBpad\fR. Only the first character of the \fBpad\fR string is
1944 used. If the terminal does not have a pad character, specify \fBnpc\fR.
1947 If the terminal can move up or down half a line, this can be indicated with
1948 \fBhu\fR (half-line up) and \fBhd\fR (half-line down). This is primarily useful
1949 for superscripts and subscripts on hardcopy terminals. If a hardcopy terminal
1950 can eject to the next page (form feed), give this as \fBff\fR (usually control
1954 If there is a command to repeat a given character a given number of times (to
1955 save time transmitting a large number of identical characters) this can be
1956 indicated with the parameterized string \fBrep\fR. The first parameter is the
1957 character to be repeated and the second is the number of times to repeat it.
1958 Thus, \fBtparm(repeat_char, 'x', 10)\fR is the same as \fBxxxxxxxxxx.\fR
1961 If the terminal has a settable command character, such as the Tektronix 4025,
1962 this can be indicated with \fBcmdch\fR. A prototype command character is chosen
1963 which is used in all capabilities. This character is given in the \fBcmdch\fR
1964 capability to identify it. The following convention is supported on some
1965 systems: If the environment variable \fBCC\fR exists, all occurrences of the
1966 prototype character are replaced with the character in \fBCC\fR.
1969 Terminal descriptions that do not represent a specific kind of known terminal,
1970 such as \fBswitch\fR, \fIdialup\fR, \fBpatch\fR, and \fInetwork\fR, should
1971 include the \fBgn\fR (generic) capability so that programs can complain that
1972 they do not know how to talk to the terminal. (This capability does not apply
1973 to \fIvirtual\fR terminal descriptions for which the escape sequences are
1974 known.) If the terminal is one of those supported by the system virtual
1975 terminal protocol, the terminal number can be given as \fBvt\fR. A
1976 line-turn-around sequence to be transmitted before doing reads should be
1977 specified in \fBrfi\fR.
1980 If the device uses xon/xoff handshaking for flow control, give \fBxon\fR.
1981 Padding information should still be included so that routines can make better
1982 decisions about costs, but actual pad characters will not be transmitted.
1983 Sequences to turn on and off xon/xoff handshaking may be given in \fBsmxon\fR
1984 and \fBrmxon\fR. If the characters used for handshaking are not \fB^S\fR and
1985 \fB^Q\fR, they may be specified with \fBxonc\fR and \fBxoffc\fR.
1988 If the terminal has a ``meta key'' which acts as a shift key, setting the 8th
1989 bit of any character transmitted, this fact can be indicated with \fBkm\fR.
1990 Otherwise, software will assume that the 8th bit is parity and it will usually
1991 be cleared. If strings exist to turn this ``meta mode'' on and off, they can be
1992 given as \fBsmm\fR and \fBrmm\fR.
1995 If the terminal has more lines of memory than will fit on the screen at once,
1996 the number of lines of memory can be indicated with \fBlm\fR. A value of
1997 \fBlm\fR#0 indicates that the number of lines is not fixed, but that there is
1998 still more memory than fits on the screen.
2001 Media copy strings which control an auxiliary printer connected to the terminal
2002 can be given as \fBmc0\fR: print the contents of the screen, \fBmc4\fR: turn
2003 off the printer, and \fBmc5\fR: turn on the printer. When the printer is on,
2004 all text sent to the terminal will be sent to the printer. A variation,
2005 \fBmc5p\fR, takes one parameter, and leaves the printer on for as many
2006 characters as the value of the parameter, then turns the printer off. The
2007 parameter should not exceed 255. If the text is not displayed on the terminal
2008 screen when the printer is on, specify \fBmc5i\fR (silent printer). All text,
2009 including \fBmc4\fR, is transparently passed to the printer while an \fBmc5p\fR
2011 .SS "Section 1-15: Special Cases"
2013 The working model used by \fBterminfo\fR fits most terminals reasonably well.
2014 However, some terminals do not completely match that model, requiring special
2015 support by \fBterminfo\fR. These are not meant to be construed as deficiencies
2016 in the terminals; they are just differences between the working model and the
2017 actual hardware. They may be unusual devices or, for some reason, do not have
2018 all the features of the \fBterminfo\fR model implemented.
2021 Terminals that cannot display tilde (~) characters, such as certain Hazeltine
2022 terminals, should indicate \fBhz\fR.
2025 Terminals that ignore a linefeed immediately after an \fBam\fR wrap, such as
2026 the Concept 100, should indicate \fBxenl\fR. Those terminals whose cursor
2027 remains on the right-most column until another character has been received,
2028 rather than wrapping immediately upon receiving the right-most character, such
2029 as the VT100, should also indicate \fBxenl\fR.
2032 If \fBel\fR is required to get rid of standout (instead of writing normal text
2033 on top of it), \fBxhp\fR should be given.
2036 Those Teleray terminals whose tabs turn all characters moved over to blanks,
2037 should indicate \fBxt\fR (destructive tabs). This capability is also taken to
2038 mean that it is not possible to position the cursor on top of a ``magic
2039 cookie.'' Therefore, to erase standout mode, it is necessary, instead, to use
2040 delete and insert line.
2043 Those Beehive Superbee terminals which do not transmit the escape or
2044 control\(miC characters, should specify \fBxsb\fR, indicating that the f1 key
2045 is to be used for escape and the f2 key for control C.
2046 .SS "Section 1-16: Similar Terminals"
2048 If there are two very similar terminals, one can be defined as being just like
2049 the other with certain exceptions. The string capability \fBuse\fR can be given
2050 with the name of the similar terminal. The capabilities given before \fBuse\fR
2051 override those in the terminal type invoked by \fBuse\fR. A capability can be
2052 canceled by placing \fIxx\fR\fB@\fR to the left of the capability definition,
2053 where \fIxx\fR is the capability. For example, the entry
2057 \fBatt4424-2|Teletype4424 in display function group ii,
2058 rev@, sgr@, smul@, use=att4424,\fR
2065 defines an AT&T4424 terminal that does not have the \fBrev\fR, \fBsgr\fR, and
2066 \fBsmul\fR capabilities, and hence cannot do highlighting. This is useful for
2067 different modes for a terminal, or for different user preferences. More than
2068 one \fBuse\fR capability may be given.
2069 .SS "PART 2: PRINTER CAPABILITIES"
2071 The \fBterminfo\fR database allows you to define capabilities of printers as
2072 well as terminals. To find out what capabilities are available for printers as
2073 well as for terminals, see the two lists under "DEVICE CAPABILITIES" that list
2074 capabilities by variable and by capability name.
2075 .SS "Section 2-1: Rounding Values"
2077 Because parameterized string capabilities work only with integer values, we
2078 recommend that \fBterminfo\fR designers create strings that expect numeric
2079 values that have been rounded. Application designers should note this and
2080 should always round values to the nearest integer before using them with a
2081 parameterized string capability.
2082 .SS "Section 2-2: Printer Resolution"
2084 A printer's resolution is defined to be the smallest spacing of characters it
2085 can achieve. In general printers have independent resolution horizontally and
2086 vertically. Thus the vertical resolution of a printer can be determined by
2087 measuring the smallest achievable distance between consecutive printing
2088 baselines, while the horizontal resolution can be determined by measuring the
2089 smallest achievable distance between the left-most edges of consecutive
2090 printed, identical, characters.
2093 All printers are assumed to be capable of printing with a uniform horizontal
2094 and vertical resolution. The view of printing that \fBterminfo\fR currently
2095 presents is one of printing inside a uniform matrix: All characters are printed
2096 at fixed positions relative to each ``cell'' in the matrix; furthermore, each
2097 cell has the same size given by the smallest horizontal and vertical step sizes
2098 dictated by the resolution. (The cell size can be changed as will be seen
2102 Many printers are capable of ``proportional printing,'' where the horizontal
2103 spacing depends on the size of the character last printed. \fBterminfo\fR does
2104 not make use of this capability, although it does provide enough capability
2105 definitions to allow an application to simulate proportional printing.
2108 A printer must not only be able to print characters as close together as the
2109 horizontal and vertical resolutions suggest, but also of ``moving'' to a
2110 position an integral multiple of the smallest distance away from a previous
2111 position. Thus printed characters can be spaced apart a distance that is an
2112 integral multiple of the smallest distance, up to the length or width of a
2116 Some printers can have different resolutions depending on different ``modes.''
2117 In ``normal mode,'' the existing \fBterminfo\fR capabilities are assumed to
2118 work on columns and lines, just like a video terminal. Thus the old \fBlines\fR
2119 capability would give the length of a page in lines, and the \fBcols\fR
2120 capability would give the width of a page in columns. In ``micro mode,'' many
2121 \fBterminfo\fR capabilities work on increments of lines and columns. With some
2122 printers the micro mode may be concomitant with normal mode, so that all the
2123 capabilities work at the same time.
2124 .SS "Section 2-3: Specifying Printer Resolution"
2126 The printing resolution of a printer is given in several ways. Each specifies
2127 the resolution as the number of smallest steps per distance:
2131 Specification of Printer Resolution
2132 Characteristic Number of Smallest Steps
2134 orhi Steps per inch horizontally
2135 orvi Steps per inch vertically
2136 orc Steps per column
2144 When printing in normal mode, each character printed causes movement to the
2145 next column, except in special cases described later; the distance moved is the
2146 same as the per-column resolution. Some printers cause an automatic movement to
2147 the next line when a character is printed in the rightmost position; the
2148 distance moved vertically is the same as the per-line resolution. When printing
2149 in micro mode, these distances can be different, and may be zero for some
2154 Specification of Printer Resolution
2155 Automatic Motion after Printing
2159 orc Steps moved horizontally
2160 orl Steps moved vertically
2164 mcs Steps moved horizontally
2165 mls Steps moved vertically
2172 Some printers are capable of printing wide characters. The distance moved when
2173 a wide character is printed in normal mode may be different from when a regular
2174 width character is printed. The distance moved when a wide character is printed
2175 in micro mode may also be different from when a regular character is printed in
2176 micro mode, but the differences are assumed to be related: If the distance
2177 moved for a regular character is the same whether in normal mode or micro mode
2178 (\fBmcs\fR=orc), then the distance moved for a wide character is also the same
2179 whether in normal mode or micro mode. This doesn't mean the normal character
2180 distance is necessarily the same as the wide character distance, just that the
2181 distances don't change with a change in normal to micro mode. However, if the
2182 distance moved for a regular character is different in micro mode from the
2183 distance moved in normal mode (\fBmcs\fR<\fBorc\fR), the micro mode distance is
2184 assumed to be the same for a wide character printed in micro mode, as the table
2189 Specification of Printer Resolution
2190 Automatic Motion after Printing Wide Character
2192 Normal Mode or Micro Mode (mcs = orc):
2194 widcs Steps moved horizontally
2196 Micro Mode (mcs < orc):
2198 mcs Steps moved horizontally
2205 There may be control sequences to change the number of columns per inch (the
2206 character pitch) and to change the number of lines per inch (the line pitch).
2207 If these are used, the resolution of the printer changes, but the type of
2208 change depends on the printer:
2212 Specification of Printer Resolution
2213 Changing the Character/Line Pitches
2215 cpi Change character pitch
2216 cpix If set, cpi changes orhi, otherwise changes
2218 lpi Change line pitch
2219 lpix If set, lpi changes orvi, otherwise changes
2221 chr Change steps per column
2222 cvr Change steps per line
2229 The \fBcpi\fR and \fBlpi\fR string capabilities are each used with a single
2230 argument, the pitch in columns (or characters) and lines per inch,
2231 respectively. The \fBchr\fR and \fBcvr\fR string capabilities are each used
2232 with a single argument, the number of steps per column and line, respectively.
2235 Using any of the control sequences in these strings will imply a change in some
2236 of the values of \fBorc\fR, \fBorhi\fR, \fBorl\fR, and \fBorvi\fR. Also, the
2237 distance moved when a wide character is printed, \fBwidcs\fR, changes in
2238 relation to \fBorc\fR. The distance moved when a character is printed in micro
2239 mode, \fBmcs\fR, changes similarly, with one exception: if the distance is 0
2240 or 1, then no change is assumed (see items marked with * in the following
2244 Programs that use \fBcpi\fR, \fBlpi\fR, \fBchr\fR, or \fBcvr\fR should
2245 recalculate the printer resolution (and should recalculate other values\(em see
2246 "Effect of Changing Printing Resolution" under "Dot-Mapped Graphics").
2250 Specification of Printer Resolution
2251 Effects of Changing the Character/Line Pitches
2255 Using cpi with cpix clear:
2257 $bold orc '$ $bold orc = bold orhi over V sub italic cpi$
2259 Using cpi with cpix set:
2260 $bold orhi '$ $bold orhi = bold orc cdot V sub italic cpi$
2261 $bold orc '$ $bold orc$
2263 Using lpi with lpix clear:
2264 $bold orvi '$ $bold orvi$
2265 $bold orl '$ $bold orl = bold orvi over V sub italic lpi$
2267 Using lpi with lpix set:
2268 $bold orvi '$ $bold orvi = bold orl cdot V sub italic lpi$
2269 $bold orl '$ $bold orl$
2272 $bold orhi '$ $bold orhi$
2273 $bold orc '$ $V sub italic chr$
2276 $bold orvi '$ $bold orvi$
2277 $bold orl '$ $V sub italic cvr$
2280 $bold widcs '$ $bold widcs = bold {widcs '} bold orc over { bold {orc '} }$
2281 $bold mcs '$ $bold mcs = bold {mcs '} bold orc over { bold {orc '} }$
2288 $V sub italic cpi$, $V sub italic lpi$, $V sub italic chr$, and $V sub italic
2289 cvr$ are the arguments used with \fBcpi\fR, \fBlpi\fR, \fBchr\fR, and
2290 \fBcvr\fR, respectively. The prime marks (\|'\|) indicate the old values.
2291 .SS "Section 2-4: Capabilities that Cause Movement"
2293 In the following descriptions, ``movement'' refers to the motion of the
2294 ``current position.'' With video terminals this would be the cursor; with some
2295 printers this is the carriage position. Other printers have different
2296 equivalents. In general, the current position is where a character would be
2297 displayed if printed.
2300 \fBterminfo\fR has string capabilities for control sequences that cause
2301 movement a number of full columns or lines. It also has equivalent string
2302 capabilities for control sequences that cause movement a number of smallest
2307 String Capabilities for Motion
2309 mcub1 Move 1 step left
2310 mcuf1 Move 1 step right
2311 mcuu1 Move 1 step up
2312 mcud1 Move 1 step down
2313 mcub Move N steps left
2314 mcuf Move N steps right
2315 mcuu Move N steps up
2316 mcud Move N steps down
2317 mhpa Move N steps from the left
2318 mvpa Move N steps from the top
2325 The latter six strings are each used with a single argument, \fIN\fR.
2328 Sometimes the motion is limited to less than the width or length of a page.
2329 Also, some printers don't accept absolute motion to the left of the current
2330 position. \fBterminfo\fR has capabilities for specifying these limits.
2336 mjump Limit on use of mcub1, mcuf1, mcuu1, mcud1
2337 maddr Limit on use of mhpa, mvpa
2338 xhpa If set, hpa and mhpa can't move left
2339 xvpa If set, vpa and mvpa can't move up
2346 If a printer needs to be in a ``micro mode'' for the motion capabilities
2347 described above to work, there are string capabilities defined to contain the
2348 control sequence to enter and exit this mode. A boolean is available for those
2349 printers where using a carriage return causes an automatic return to normal
2354 Entering/Exiting Micro Mode
2356 smicm Enter micro mode
2357 rmicm Exit micro mode
2358 crxm Using cr exits micro mode
2365 The movement made when a character is printed in the rightmost position varies
2366 among printers. Some make no movement, some move to the beginning of the next
2367 line, others move to the beginning of the same line. \fBterminfo\fRhas boolean
2368 capabilities for describing all three cases.
2372 What Happens After Character
2373 Printed in Rightmost Position
2375 sam Automatic move to beginning of same line
2382 Some printers can be put in a mode where the normal direction of motion is
2383 reversed. This mode can be especially useful when there are no capabilities for
2384 leftward or upward motion, because those capabilities can be built from the
2385 motion reversal capability and the rightward or downward motion capabilities.
2386 It is best to leave it up to an application to build the leftward or upward
2387 capabilities, though, and not enter them in the \fBterminfo\fR database. This
2388 allows several reverse motions to be strung together without intervening wasted
2389 steps that leave and reenter reverse mode.
2393 Entering/Exiting Reverse Modes
2395 slm Reverse sense of horizontal motions
2396 rlm Restore sense of horizontal motions
2397 sum Reverse sense of vertical motions
2398 rum Restore sense of vertical motions
2400 While sense of horizontal motions reversed:
2401 mcub1 Move 1 step right
2402 mcuf1 Move 1 step left
2403 mcub Move N steps right
2404 mcuf Move N steps left
2405 cub1 Move 1 column right
2406 cuf1 Move 1 column left
2407 cub Move N columns right
2408 cuf Move N columns left
2410 While sense of vertical motions reversed:
2411 mcuu1 Move 1 step down
2412 mcud1 Move 1 step up
2413 mcuu Move N steps down
2414 mcud Move N steps up
2415 cuu1 Move 1 line down
2417 cuu Move N lines down
2425 The reverse motion modes should not affect the \fBmvpa\fR and \fBmhpa\fR
2426 absolute motion capabilities. The reverse vertical motion mode should, however,
2427 also reverse the action of the line ``wrapping'' that occurs when a character
2428 is printed in the right-most position. Thus printers that have the standard
2429 \fBterminfo\fR capability \fBam\fR defined should experience motion to the
2430 beginning of the previous line when a character is printed in the right-most
2431 position under reverse vertical motion mode.
2434 The action when any other motion capabilities are used in reverse motion modes
2435 is not defined; thus, programs must exit reverse motion modes before using
2436 other motion capabilities.
2439 Two miscellaneous capabilities complete the list of new motion capabilities.
2440 One of these is needed for printers that move the current position to the
2441 beginning of a line when certain control characters, such as ``line-feed'' or
2442 ``form-feed,'' are used. The other is used for the capability of suspending the
2443 motion that normally occurs after printing a character.
2447 Miscellaneous Motion Strings
2449 docr List of control characters causing cr
2450 zerom Prevent auto motion after printing next single character
2457 \fBterminfo\fR provides two strings for setting margins on terminals: one for
2458 the left and one for the right margin. Printers, however, have two additional
2459 margins, for the top and bottom margins of each page. Furthermore, some
2460 printers require not using motion strings to move the current position to a
2461 margin and then fixing the margin there, but require the specification of where
2462 a margin should be regardless of the current position. Therefore \fBterminfo\fR
2463 offers six additional strings for defining margins with printers.
2469 smgl Set left margin at current column
2470 smgr Set right margin at current column
2471 smgb Set bottom margin at current line
2472 smgt Set top margin at current line
2473 smgbp Set bottom margin at line N
2474 smglp Set left margin at column N
2475 smgrp Set right margin at column N
2476 smgtp Set top margin at line N
2483 The last four strings are used with one or more arguments that give the
2484 position of the margin or margins to set. If both of \fBsmglp\fR and
2485 \fBsmgrp\fR are set, each is used with a single argument, \fIN,\fR that gives
2486 the column number of the left and right margin, respectively. If both of
2487 \fBsmgtp\fR and \fBsmgbp\fR are set, each is used to set the top and bottom
2488 margin, respectively: \fBsmgtp\fR is used with a single argument, \fIN,\fR the
2489 line number of the top margin; however, \fBsmgbp\fR is used with two arguments,
2490 \fIN\fR and \fIM,\fR that give the line number of the bottom margin, the first
2491 counting from the top of the page and the second counting from the bottom. This
2492 accommodates the two styles of specifying the bottom margin in different
2493 manufacturers' printers. When coding a \fBterminfo\fR entry for a printer that
2494 has a settable bottom margin, only the first or second parameter should be
2495 used, depending on the printer. When writing an application that uses
2496 \fBsmgbp\fR to set the bottom margin, both arguments must be given.
2499 If only one of \fBsmglp\fR and \fBsmgrp\fR is set, then it is used with two
2500 arguments, the column number of the left and right margins, in that order.
2501 Likewise, if only one of \fBsmgtp\fR and \fBsmgbp\fR is set, then it is used
2502 with two arguments that give the top and bottom margins, in that order,
2503 counting from the top of the page. Thus when coding a \fBterminfo\fR entry for
2504 a printer that requires setting both left and right or top and bottom margins
2505 simultaneously, only one of \fBsmglp\fR and \fBsmgrp\fR or \fBsmgtp\fR and
2506 \fBsmgbp\fR should be defined; the other should be left blank. When writing an
2507 application that uses these string capabilities, the pairs should be first
2508 checked to see if each in the pair is set or only one is set, and should then
2509 be used accordingly.
2512 In counting lines or columns, line zero is the top line and column zero is the
2513 left-most column. A zero value for the second argument with \fBsmgbp\fR means
2514 the bottom line of the page.
2517 All margins can be cleared with \fBmgc\fR.
2518 .SS "Shadows, Italics, Wide Characters"
2520 Five new sets of strings describe the capabilities printers have of enhancing
2527 sshm Enter shadow-printing mode
2528 rshm Exit shadow-printing mode
2529 sitm Enter italicizing mode
2530 ritm Exit italicizing mode
2531 swidm Enter wide character mode
2532 rwidm Exit wide character mode
2533 ssupm Enter superscript mode
2535 m Exit superscript mode
2536 supcs List of characters available as superscripts
2537 ssubm Enter subscript mode
2538 rsubm Exit subscript mode
2539 subcs List of characters available as subscripts
2546 If a printer requires the \fBsshm\fR control sequence before every character to
2547 be shadow-printed, the \fBrshm\fR string is left blank. Thus programs that find
2548 a control sequence in \fBsshm\fR but none in \fBrshm\fR should use the
2549 \fBsshm\fR control sequence before every character to be shadow-printed;
2550 otherwise, the \fBsshm\fR control sequence should be used once before the set
2551 of characters to be shadow-printed, followed by \fBrshm\fR. The same is also
2552 true of each of the \fBsitm\fR/\fBritm\fR, \fBswidm\fR/\fBrwidm\fR,
2553 \fBssupm\fR/\fBrsupm\fR, and \fBssubm\fR/ \fBrsubm\fR pairs.
2556 Note that \fBterminfo\fR also has a capability for printing emboldened text
2557 (\fBbold\fR). While shadow printing and emboldened printing are similar in that
2558 they ``darken'' the text, many printers produce these two types of print in
2559 slightly different ways. Generally, emboldened printing is done by overstriking
2560 the same character one or more times. Shadow printing likewise usually involves
2561 overstriking, but with a slight movement up and/or to the side so that the
2562 character is ``fatter.''
2565 It is assumed that enhanced printing modes are independent modes, so that it
2566 would be possible, for instance, to shadow print italicized subscripts.
2569 As mentioned earlier, the amount of motion automatically made after printing a
2570 wide character should be given in \fBwidcs\fR.
2573 If only a subset of the printable ASCII characters can be printed as
2574 superscripts or subscripts, they should be listed in \fBsupcs\fR or \fBsubcs\fR
2575 strings, respectively. If the \fBssupm\fR or \fBssubm\fR strings contain
2576 control sequences, but the corresponding \fBsupcs\fR or \fBsubcs\fR strings are
2577 empty, it is assumed that all printable ASCII characters are available as
2578 superscripts or subscripts.
2581 Automatic motion made after printing a superscript or subscript is assumed to
2582 be the same as for regular characters. Thus, for example, printing any of the
2583 following three examples will result in equivalent motion:
2589 Note that the existing \fBmsgr\fR boolean capability describes whether motion
2590 control sequences can be used while in ``standout mode.'' This capability is
2591 extended to cover the enhanced printing modes added here. \fBmsgr\fR should be
2592 set for those printers that accept any motion control sequences without
2593 affecting shadow, italicized, widened, superscript, or subscript printing.
2594 Conversely, if \fBmsgr\fR is not set, a program should end these modes before
2595 attempting any motion.
2596 .SS "Section 2-5: Alternate Character Sets"
2598 In addition to allowing you to define line graphics (described in Section
2599 1-12), \fBterminfo\fR lets you define alternate character sets. The following
2600 capabilities cover printers and terminals with multiple selectable or definable
2605 Alternate Character Sets
2607 scs Select character set N
2608 scsd Start definition of character set N, M characters
2609 defc Define character A, B dots wide, descender D
2610 rcsd End definition of character set N
2611 csnm List of character set names
2612 daisy Printer has manually changed print-wheels
2619 The \fBscs\fR, \fBrcsd\fR, and \fBcsnm\fR strings are used with a single
2620 argument, \fIN\fR, a number from 0 to 63 that identifies the character set. The
2621 \fBscsd\fR string is also used with the argument \fIN\fR and another, \fIM\fR,
2622 that gives the number of characters in the set. The \fBdefc\fR string is used
2623 with three arguments: \fIA\fR gives the ASCII code representation for the
2624 character, \fIB\fR gives the width of the character in dots, and \fID\fR is
2625 zero or one depending on whether the character is a ``descender'' or not. The
2626 \fBdefc\fR string is also followed by a string of ``image-data'' bytes that
2627 describe how the character looks (see below).
2630 Character set 0 is the default character set present after the printer has been
2631 initialized. Not every printer has 64 character sets, of course; using
2632 \fBscs\fR with an argument that doesn't select an available character set
2633 should cause a null result from \fBtparm\fR.
2636 If a character set has to be defined before it can be used, the \fBscsd\fR
2637 control sequence is to be used before defining the character set, and the
2638 \fBrcsd\fR is to be used after. They should also cause a null result from
2639 \fBtparm\fR when used with an argument \fIN\fR that doesn't apply. If a
2640 character set still has to be selected after being defined, the \fBscs\fR
2641 control sequence should follow the \fBrcsd\fR control sequence. By examining
2642 the results of using each of the \fBscs\fR, \fBscsd\fR, and \fBrcsd\fR strings
2643 with a character set number in a call to \fBtparm\fR, a program can determine
2644 which of the three are needed.
2647 Between use of the \fBscsd\fR and \fBrcsd\fR strings, the \fBdefc\fR string
2648 should be used to define each character. To print any character on printers
2649 covered by \fBterminfo\fR, the ASCII code is sent to the printer. This is true
2650 for characters in an alternate set as well as ``normal'' characters. Thus the
2651 definition of a character includes the ASCII code that represents it. In
2652 addition, the width of the character in dots is given, along with an indication
2653 of whether the character should descend below the print line (such as the lower
2654 case letter ``g'' in most character sets). The width of the character in dots
2655 also indicates the number of image-data bytes that will follow the \fBdefc\fR
2656 string. These image-data bytes indicate where in a dot-matrix pattern ink
2657 should be applied to ``draw'' the character; the number of these bytes and
2658 their form are defined below under ``Dot-Mapped Graphics.''
2661 It's easiest for the creator of \fBterminfo\fR entries to refer to each
2662 character set by number; however, these numbers will be meaningless to the
2663 application developer. The \fBcsnm\fR string alleviates this problem by
2664 providing names for each number.
2667 When used with a character set number in a call to \fBtparm\fR, the \fBcsnm\fR
2668 string will produce the equivalent name. These names should be used as a
2669 reference only. No naming convention is implied, although anyone who creates a
2670 \fBterminfo\fR entry for a printer should use names consistent with the names
2671 found in user documents for the printer. Application developers should allow a
2672 user to specify a character set by number (leaving it up to the user to examine
2673 the \fBcsnm\fR string to determine the correct number), or by name, where the
2674 application examines the \fBcsnm\fR string to determine the corresponding
2675 character set number.
2678 These capabilities are likely to be used only with dot-matrix printers. If they
2679 are not available, the strings should not be defined. For printers that have
2680 manually changed print-wheels or font cartridges, the boolean \fBdaisy\fR is
2682 .SS "Section 2-6: Dot-Matrix Graphics"
2684 Dot-matrix printers typically have the capability of reproducing
2685 ``raster-graphics'' images. Three new numeric capabilities and three new string
2686 capabilities can help a program draw raster-graphics images independent of the
2687 type of dot-matrix printer or the number of pins or dots the printer can handle
2694 npins Number of pins, N, in print-head
2695 spinv Spacing of pins vertically in pins per inch
2696 spinh Spacing of dots horizontally in dots per inch
2697 porder Matches software bits to print-head pins
2698 sbim Start printing bit image graphics, B bits wide
2699 rbim End printing bit image graphics
2706 The \fBsbim\fR sring is used with a single argument, \fIB\fR, the width of the
2710 The model of dot-matrix or raster-graphics that \fBterminfo\fR presents is
2711 similar to the technique used for most dot-matrix printers: each pass of the
2712 printer's print-head is assumed to produce a dot-matrix that is \fIN\fR dots
2713 high and \fIB\fR dots wide. This is typically a wide, squat, rectangle of dots.
2714 The height of this rectangle in dots will vary from one printer to the next;
2715 this is given in the \fBnpins\fR numeric capability. The size of the rectangle
2716 in fractions of an inch will also vary; it can be deduced from the \fBspinv\fR
2717 and \fBspinh\fR numeric capabilities. With these three values an application
2718 can divide a complete raster-graphics image into several horizontal strips,
2719 perhaps interpolating to account for different dot spacing vertically and
2723 The \fBsbim\fR and \fBrbim\fR strings are used to start and end a dot-matrix
2724 image, respectively. The \fBsbim\fR string is used with a single argument that
2725 gives the width of the dot-matrix in dots. A sequence of ``image-data bytes''
2726 are sent to the printer after the \fBsbim\fR string and before the \fBrbim\fR
2727 string. The number of bytes is a integral multiple of the width of the
2728 dot-matrix; the multiple and the form of each byte is determined by the
2729 \fBporder\fR string as described below.
2732 The \fBporder\fR string is a comma separated list of pin numbers optionally
2733 followed by an numerical offset. The offset, if given, is separated from the
2734 list with a semicolon. The position of each pin number in the list corresponds
2735 to a bit in an 8-bit data byte. The pins are numbered consecutively from 1 to
2736 \fBnpins\fR, with 1 being the top pin. Note that the term ``pin'' is used
2737 loosely here; ``ink-jet'' dot-matrix printers don't have pins, but can be
2738 considered to have an equivalent method of applying a single dot of ink to
2739 paper. The bit positions in \fBporder\fR are in groups of 8, with the first
2740 position in each group the most significant bit and the last position the least
2741 significant bit. An application produces 8-bit bytes in the order of the groups
2745 An application computes the ``image-data bytes'' from the internal image,
2746 mapping vertical dot positions in each print-head pass into 8-bit bytes, using
2747 a 1 bit where ink should be applied and 0 where no ink should be applied. This
2748 can be reversed (0 bit for ink, 1 bit for no ink) by giving a negative pin
2749 number. If a position is skipped in \fBporder\fR, a 0 bit is used. If a
2750 position has a lower case `x' instead of a pin number, a 1 bit is used in the
2751 skipped position. For consistency, a lower case `o' can be used to represent a
2752 0 filled, skipped bit. There must be a multiple of 8 bit positions used or
2753 skipped in \fBporder\fR; if not, 0 bits are used to fill the last byte in the
2754 least significant bits. The offset, if given, is added to each data byte; the
2755 offset can be negative.
2758 Some examples may help clarify the use of the \fBporder\fR string. The AT&T
2759 470, AT&T 475 and C.Itoh 8510 printers provide eight pins for graphics. The
2760 pins are identified top to bottom by the 8 bits in a byte, from least
2761 significant to most. The \fBporder\fR strings for these printers would be
2762 \fB8,7,6,5,4,3,2,1\fR. The AT&T 478 and AT&T 479 printers also provide eight
2763 pins for graphics. However, the pins are identified in the reverse order. The
2764 \fBporder\fR strings for these printers would be \fB1,2,3,4,5,6,7,8\fR. The
2765 AT&T 5310, AT&T 5320, DEC LA100, and DEC LN03 printers provide six pins for
2766 graphics. The pins are identified top to bottom by the decimal values 1, 2, 4,
2767 8, 16 and 32. These correspond to the low six bits in an 8-bit byte, although
2768 the decimal values are further offset by the value 63. The \fBporder\fR string
2769 for these printers would be \fB,,6,5,4,3,2,1;63\fR, or alternately
2770 \fBo,o,6,5,4,3,2,1;63\fR.
2771 .SS "Section 2-7: Effect of Changing Printing Resolution"
2773 If the control sequences to change the character pitch or the line pitch are
2774 used, the pin or dot spacing may change:
2779 Changing the Character/Line Pitches
2781 cpi Change character pitch
2782 cpix If set, cpi changes spinh
2783 lpi Change line pitch
2784 lpix If set, lpi changes spinv
2791 Programs that use \fBcpi\fR or \fBlpi\fR should recalculate the dot spacing:
2796 Effects of Changing the Character/Line Pitches
2800 Using cpi with cpix clear:
2801 $bold spinh '$ $bold spinh$
2803 Using cpi with cpix set:
2804 $bold spinh '$ $bold spinh = bold spinh ' cdot bold orhi over
2807 Using lpi with lpix clear:
2808 $bold spinv '$ $bold spinv$
2810 Using lpi with lpix set:
2811 $bold spinv '$ $bold spinv = bold {spinv '} cdot bold orhi over
2815 $bold spinh '$ $bold spinh$
2818 $bold spinv '$ $bold spinv$
2825 \fBorhi\fR' and \fBorhi\fR are the values of the horizontal resolution in steps
2826 per inch, before using \fBcpi\fR and after using \fBcpi\fR, respectively.
2827 Likewise, \fBorvi'\fR and \fBorvi\fR are the values of the vertical resolution
2828 in steps per inch, before using \fBlpi\fR and after using \fBlpi\fR,
2829 respectively. Thus, the changes in the dots per inch for dot-matrix graphics
2830 follow the changes in steps per inch for printer resolution.
2831 .SS "Section 2-8: Print Quality"
2833 Many dot-matrix printers can alter the dot spacing of printed text to produce
2834 near ``letter quality'' printing or ``draft quality'' printing. Usually it is
2835 important to be able to choose one or the other because the rate of printing
2836 generally falls off as the quality improves. There are three new strings used
2837 to describe these capabilities.
2843 snlq Set near-letter quality print
2844 snrmq Set normal quality print
2845 sdrfq Set draft quality print
2852 The capabilities are listed in decreasing levels of quality. If a printer
2853 doesn't have all three levels, one or two of the strings should be left blank
2855 .SS "Section 2-9: Printing Rate and Buffer Size"
2857 Because there is no standard protocol that can be used to keep a program
2858 synchronized with a printer, and because modern printers can buffer data before
2859 printing it, a program generally cannot determine at any time what has been
2860 printed. Two new numeric capabilities can help a program estimate what has been
2865 Print Rate/Buffer Size
2867 cps Nominal print rate in characters per second
2868 bufsz Buffer capacity in characters
2875 \fBcps\fR is the nominal or average rate at which the printer prints
2876 characters; if this value is not given, the rate should be estimated at
2877 one-tenth the prevailing baud rate. \fBbufsz\fR is the maximum number of
2878 subsequent characters buffered before the guaranteed printing of an earlier
2879 character, assuming proper flow control has been used. If this value is not
2880 given it is assumed that the printer does not buffer characters, but prints
2881 them as they are received.
2884 As an example, if a printer has a 1000-character buffer, then sending the
2885 letter ``a'' followed by 1000 additional characters is guaranteed to cause the
2886 letter ``a'' to print. If the same printer prints at the rate of 100 characters
2887 per second, then it should take 10 seconds to print all the characters in the
2888 buffer, less if the buffer is not full. By keeping track of the characters sent
2889 to a printer, and knowing the print rate and buffer size, a program can
2890 synchronize itself with the printer.
2893 Note that most printer manufacturers advertise the maximum print rate, not the
2894 nominal print rate. A good way to get a value to put in for \fBcps\fR is to
2895 generate a few pages of text, count the number of printable characters, and
2896 then see how long it takes to print the text.
2899 Applications that use these values should recognize the variability in the
2900 print rate. Straight text, in short lines, with no embedded control sequences
2901 will probably print at close to the advertised print rate and probably faster
2902 than the rate in \fBcps\fR. Graphics data with a lot of control sequences, or
2903 very long lines of text, will print at well below the advertised rate and below
2904 the rate in \fBcps\fR. If the application is using \fBcps\fR to decide how long
2905 it should take a printer to print a block of text, the application should pad
2906 the estimate. If the application is using \fBcps\fR to decide how much text has
2907 already been printed, it should shrink the estimate. The application will thus
2908 err in favor of the user, who wants, above all, to see all the output in its
2913 \fB\fB/usr/share/lib/terminfo/?/*\fR\fR
2917 compiled terminal description database
2923 \fB\fB/usr/share/lib/.COREterm/?/*\fR\fR
2927 subset of compiled terminal description database
2933 \fB\fB/usr/share/lib/tabset/*\fR\fR
2937 tab settings for some terminals, in a format appropriate to be output to the
2938 terminal (escape sequences that set margins and tabs)
2943 \fBls\fR(1), \fBpg\fR(1), \fBstty\fR(1), \fBtput\fR(1), \fBtty\fR(1),
2944 \fBvi\fR(1), \fBinfocmp\fR(8), \fBtic\fR(8), \fBprintf\fR(3C),
2945 \fBcurses\fR(3CURSES), \fBcurses\fR(3XCURSES)
2948 The most effective way to prepare a terminal description is by imitating the
2949 description of a similar terminal in \fBterminfo\fR and to build up a
2950 description gradually, using partial descriptions with a screen oriented
2951 editor, such as \fBvi\fR, to check that they are correct. To easily test a new
2952 terminal description the environment variable \fBTERMINFO\fR can be set to the
2953 pathname of a directory containing the compiled description, and programs will
2954 look there rather than in \fB/usr/share/lib/terminfo\fR.