d5b309f21a31db974704118e5cadd5bf0fbf2740
[platform/upstream/bash.git] / lib / termcap / grot / termcap.info-3
1 This is Info file ./termcap.info, produced by Makeinfo-1.55 from the
2 input file ./termcap.texi.
3
4    This file documents the termcap library of the GNU system.
5
6    Copyright (C) 1988 Free Software Foundation, Inc.
7
8    Permission is granted to make and distribute verbatim copies of this
9 manual provided the copyright notice and this permission notice are
10 preserved on all copies.
11
12    Permission is granted to copy and distribute modified versions of
13 this manual under the conditions for verbatim copying, provided that
14 the entire resulting derived work is distributed under the terms of a
15 permission notice identical to this one.
16
17    Permission is granted to copy and distribute translations of this
18 manual into another language, under the above conditions for modified
19 versions, except that this permission notice may be stated in a
20 translation approved by the Foundation.
21
22 \1f
23 File: termcap.info,  Node: Insdel Char,  Next: Standout,  Prev: Insdel Line,  Up: Capabilities
24
25 Insert/Delete Character
26 =======================
27
28    "Inserting a character" means creating a blank space in the middle
29 of a line, and pushing the rest of the line rightward.  The character
30 in the rightmost column is lost.
31
32    "Deleting a character" means causing the character to disappear from
33 the screen, closing up the gap by moving the rest of the line leftward.
34 A blank space appears in the rightmost column.
35
36    Insertion and deletion of characters is useful in programs that
37 maintain an updating display some parts of which may get longer or
38 shorter.  It is also useful in editors for redisplaying the results of
39 editing within a line.
40
41    Many terminals provide commands to insert or delete a single
42 character at the cursor position.  Some provide the ability to insert
43 or delete several characters with one command, using the number of
44 characters to insert or delete as a parameter.
45
46    Many terminals provide an insert mode in which outputting a graphic
47 character has the added effect of inserting a position for that
48 character.  A special command string is used to enter insert mode and
49 another is used to exit it.  The reason for designing a terminal with
50 an insert mode rather than an insert command is that inserting
51 character positions is usually followed by writing characters into
52 them.  With insert mode, this is as fast as simply writing the
53 characters, except for the fixed overhead of entering and leaving
54 insert mode.  However, when the line speed is great enough, padding may
55 be required for the graphic characters output in insert mode.
56
57    Some terminals require you to enter insert mode and then output a
58 special command for each position to be inserted.  Or they may require
59 special commands to be output before or after each graphic character to
60 be inserted.
61
62    Deletion of characters is usually accomplished by a straightforward
63 command to delete one or several positions; but on some terminals, it
64 is necessary to enter a special delete mode before using the delete
65 command, and leave delete mode afterward.  Sometimes delete mode and
66 insert mode are the same mode.
67
68    Some terminals make a distinction between character positions in
69 which a space character has been output and positions which have been
70 cleared.  On these terminals, the effect of insert or delete character
71 runs to the first cleared position rather than to the end of the line.
72 In fact, the effect may run to more than one line if there is no
73 cleared position to stop the shift on the first line.  These terminals
74 are identified by the `in' flag capability.
75
76    On terminals with the `in' flag, the technique of skipping over
77 characters that you know were cleared, and then outputting text later
78 on in the same line, causes later insert and delete character
79 operations on that line to do nonstandard things.  A program that has
80 any chance of doing this must check for the `in' flag and must be
81 careful to write explicit space characters into the intermediate
82 columns when `in' is present.
83
84    A plethora of terminal capabilities are needed to describe all of
85 this complexity.  Here is a list of them all.  Following the list, we
86 present an algorithm for programs to use to take proper account of all
87 of these capabilities.
88
89 `im'
90      String of commands to enter insert mode.
91
92      If the terminal has no special insert mode, but it can insert
93      characters with a special command, `im' should be defined with a
94      null value, because the `vi' editor assumes that insertion of a
95      character is impossible if `im' is not provided.
96
97      New programs should not act like `vi'.  They should pay attention
98      to `im' only if it is defined.
99
100 `ei'
101      String of commands to leave insert mode.  This capability must be
102      present if `im' is.
103
104      On a few old terminals the same string is used to enter and exit
105      insert mode.  This string turns insert mode on if it was off, and
106      off it it was on.  You can tell these terminals because the `ei'
107      string equals the `im' string.  If you want to support these
108      terminals, you must always remember accurately whether insert mode
109      is in effect.  However, these terminals are obsolete, and it is
110      reasonable to refuse to support them.  On all modern terminals, you
111      can safely output `ei' at any time to ensure that insert mode is
112      turned off.
113
114 `ic'
115      String of commands to insert one character position at the cursor.
116      The cursor does not move.
117
118      If outputting a graphic character while in insert mode is
119      sufficient to insert the character, then the `ic' capability
120      should be defined with a null value.
121
122      If your terminal offers a choice of ways to insert--either use
123      insert mode or use a special command--then define `im' and do not
124      define `ic', since this gives the most efficient operation when
125      several characters are to be inserted.  *Do not* define both
126      strings, for that means that *both* must be used each time
127      insertion is done.
128
129 `ip'
130      String of commands to output following an inserted graphic
131      character in insert mode.  Often it is used just for a padding
132      spec, when padding is needed after an inserted character (*note
133      Padding::.).
134
135 `IC'
136      String of commands to insert N character positions at and after
137      the cursor.  It has the same effect as repeating the `ic' string
138      and a space, N times.
139
140      If `IC' is provided, application programs may use it without first
141      entering insert mode.
142
143 `mi'
144      Flag whose presence means it is safe to move the cursor while in
145      insert mode and assume the terminal remains in insert mode.
146
147 `in'
148      Flag whose presence means that the terminal distinguishes between
149      character positions in which space characters have been output and
150      positions which have been cleared.
151
152    An application program can assume that the terminal can do character
153 insertion if *any one of* the capabilities `IC', `im', `ic' or `ip' is
154 provided.
155
156    To insert N blank character positions, move the cursor to the place
157 to insert them and follow this algorithm:
158
159   1. If an `IC' string is provided, output it with parameter N and you
160      are finished.  Otherwise (or if you don't want to bother to look
161      for an `IC' string) follow the remaining steps.
162
163   2. Output the `im' string, if there is one, unless the terminal is
164      already in insert mode.
165
166   3. Repeat steps 4 through 6, N times.
167
168   4. Output the `ic' string if any.
169
170   5. Output a space.
171
172   6. Output the `ip' string if any.
173
174   7. Output the `ei' string, eventually, to exit insert mode.  There is
175      no need to do this right away.  If the `mi' flag is present, you
176      can move the cursor and the cursor will remain in insert mode;
177      then you can do more insertion elsewhere without reentering insert
178      mode.
179
180    To insert N graphic characters, position the cursor and follow this
181 algorithm:
182
183   1. If an `IC' string is provided, output it with parameter N, then
184      output the graphic characters, and you are finished.  Otherwise
185      (or if you don't want to bother to look for an `IC' string) follow
186      the remaining steps.
187
188   2. Output the `im' string, if there is one, unless the terminal is
189      already in insert mode.
190
191   3. For each character to be output, repeat steps 4 through 6.
192
193   4. Output the `ic' string if any.
194
195   5. Output the next graphic character.
196
197   6. Output the `ip' string if any.
198
199   7. Output the `ei' string, eventually, to exit insert mode.  There is
200      no need to do this right away.  If the `mi' flag is present, you
201      can move the cursor and the cursor will remain in insert mode;
202      then you can do more insertion elsewhere without reentering insert
203      mode.
204
205    Note that this is not the same as the original Unix termcap
206 specifications in one respect: it assumes that the `IC' string can be
207 used without entering insert mode.  This is true as far as I know, and
208 it allows you be able to avoid entering and leaving insert mode, and
209 also to be able to avoid the inserted-character padding after the
210 characters that go into the inserted positions.
211
212    Deletion of characters is less complicated; deleting one column is
213 done by outputting the `dc' string.  However, there may be a delete
214 mode that must be entered with `dm' in order to make `dc' work.
215
216 `dc'
217      String of commands to delete one character position at the cursor.
218      If `dc' is not present, the terminal cannot delete characters.
219
220 `DC'
221      String of commands to delete N characters starting at the cursor.
222      It has the same effect as repeating the `dc' string N times.  Any
223      terminal description that has `DC' also has `dc'.
224
225 `dm'
226      String of commands to enter delete mode.  If not present, there is
227      no delete mode, and `dc' can be used at any time (assuming there is
228      a `dc').
229
230 `ed'
231      String of commands to exit delete mode.  This must be present if
232      `dm' is.
233
234    To delete N character positions, position the cursor and follow these
235 steps:
236
237   1. If the `DC' string is present, output it with parameter N and you
238      are finished.  Otherwise, follow the remaining steps.
239
240   2. Output the `dm' string, unless you know the terminal is already in
241      delete mode.
242
243   3. Output the `dc' string N times.
244
245   4. Output the `ed' string eventually.  If the flag capability `mi' is
246      present, you can move the cursor and do more deletion without
247      leaving and reentering delete mode.
248
249    As with the `IC' string, we have departed from the original termcap
250 specifications by assuming that `DC' works without entering delete mode
251 even though `dc' would not.
252
253    If the `dm' and `im' capabilities are both present and have the same
254 value, it means that the terminal has one mode for both insertion and
255 deletion.  It is useful for a program to know this, because then it can
256 do insertions after deletions, or vice versa, without leaving
257 insert/delete mode and reentering it.
258
259 \1f
260 File: termcap.info,  Node: Standout,  Next: Underlining,  Prev: Insdel Char,  Up: Capabilities
261
262 Standout and Appearance Modes
263 =============================
264
265    "Appearance modes" are modifications to the ways characters are
266 displayed.  Typical appearance modes include reverse video, dim, bright,
267 blinking, underlined, invisible, and alternate character set.  Each
268 kind of terminal supports various among these, or perhaps none.
269
270    For each type of terminal, one appearance mode or combination of
271 them that looks good for highlighted text is chosen as the "standout
272 mode".  The capabilities `so' and `se' say how to enter and leave
273 standout mode.  Programs that use appearance modes only to highlight
274 some text generally use the standout mode so that they can work on as
275 many terminals as possible.  Use of specific appearance modes other
276 than "underlined" and "alternate character set" is rare.
277
278    Terminals that implement appearance modes fall into two general
279 classes as to how they do it.
280
281    In some terminals, the presence or absence of any appearance mode is
282 recorded separately for each character position.  In these terminals,
283 each graphic character written is given the appearance modes current at
284 the time it is written, and keeps those modes until it is erased or
285 overwritten.  There are special commands to turn the appearance modes
286 on or off for characters to be written in the future.
287
288    In other terminals, the change of appearance modes is represented by
289 a marker that belongs to a certain screen position but affects all
290 following screen positions until the next marker.  These markers are
291 traditionally called "magic cookies".
292
293    The same capabilities (`so', `se', `mb' and so on) for turning
294 appearance modes on and off are used for both magic-cookie terminals
295 and per-character terminals.  On magic cookie terminals, these give the
296 commands to write the magic cookies.  On per-character terminals, they
297 change the current modes that affect future output and erasure.  Some
298 simple applications can use these commands without knowing whether or
299 not they work by means of cookies.
300
301    However, a program that maintains and updates a display needs to know
302 whether the terminal uses magic cookies, and exactly what their effect
303 is.  This information comes from the `sg' capability.
304
305    The `sg' capability is a numeric capability whose presence indicates
306 that the terminal uses magic cookies for appearance modes.  Its value is
307 the number of character positions that a magic cookie occupies.  Usually
308 the cookie occupies one or more character positions on the screen, and
309 these character positions are displayed as blank, but in some terminals
310 the cookie has zero width.
311
312    The `sg' capability describes both the magic cookie to turn standout
313 on and the cookie to turn it off.  This makes the assumption that both
314 kinds of cookie have the same width on the screen.  If that is not true,
315 the narrower cookie must be "widened" with spaces until it has the same
316 width as the other.
317
318    On some magic cookie terminals, each line always starts with normal
319 display; in other words, the scope of a magic cookie never extends over
320 more than one line.  But on other terminals, one magic cookie affects
321 all the lines below it unless explicitly canceled.  Termcap does not
322 define any way to distinguish these two ways magic cookies can work.
323 To be safe, it is best to put a cookie at the beginning of each line.
324
325    On some per-character terminals, standout mode or other appearance
326 modes may be canceled by moving the cursor.  On others, moving the
327 cursor has no effect on the state of the appearance modes.  The latter
328 class of terminals are given the flag capability `ms' ("can move in
329 standout").  All programs that might have occasion to move the cursor
330 while appearance modes are turned on must check for this flag; if it is
331 not present, they should reset appearance modes to normal before doing
332 cursor motion.
333
334    A program that has turned on only standout mode should use `se' to
335 reset the standout mode to normal.  A program that has turned on only
336 alternate character set mode should use `ae' to return it to normal.
337 If it is possible that any other appearance modes are turned on, use the
338 `me' capability to return them to normal.
339
340    Note that the commands to turn on one appearance mode, including `so'
341 and `mb' ... `mr', if used while some other appearance modes are turned
342 on, may combine the two modes on some terminals but may turn off the
343 mode previously enabled on other terminals.  This is because some
344 terminals do not have a command to set or clear one appearance mode
345 without changing the others.  Programs should not attempt to use
346 appearance modes in combination except with `sa', and when switching
347 from one single mode to another should always turn off the previously
348 enabled mode and then turn on the new desired mode.
349
350    On some old terminals, the `so' and `se' commands may be the same
351 command, which has the effect of turning standout on if it is off, or
352 off it is on.  It is therefore risky for a program to output extra `se'
353 commands for good measure.  Fortunately, all these terminals are
354 obsolete.
355
356    Programs that update displays in which standout-text may be replaced
357 with non-standout text must check for the `xs' flag.  In a per-character
358 terminal, this flag says that the only way to remove standout once
359 written is to clear that portion of the line with the `ce' string or
360 something even more powerful (*note Clearing::.); just writing new
361 characters at those screen positions will not change the modes in
362 effect there.  In a magic cookie terminal, `xs' says that the only way
363 to remove a cookie is to clear a portion of the line that includes the
364 cookie; writing a different cookie at the same position does not work.
365
366    Such programs must also check for the `xt' flag, which means that the
367 terminal is a Teleray 1061.  On this terminal it is impossible to
368 position the cursor at the front of a magic cookie, so the only two
369 ways to remove a cookie are (1) to delete the line it is on or (2) to
370 position the cursor at least one character before it (possibly on a
371 previous line) and output the `se' string, which on these terminals
372 finds and removes the next `so' magic cookie on the screen.  (It may
373 also be possible to remove a cookie which is not at the beginning of a
374 line by clearing that line.)  The `xt' capability also has implications
375 for the use of tab characters, but in that regard it is obsolete (*Note
376 Cursor Motion::).
377
378 `so'
379      String of commands to enter standout mode.
380
381 `se'
382      String of commands to leave standout mode.
383
384 `sg'
385      Numeric capability, the width on the screen of the magic cookie.
386      This capability is absent in terminals that record appearance modes
387      character by character.
388
389 `ms'
390      Flag whose presence means that it is safe to move the cursor while
391      the appearance modes are not in the normal state.  If this flag is
392      absent, programs should always reset the appearance modes to
393      normal before moving the cursor.
394
395 `xs'
396      Flag whose presence means that the only way to reset appearance
397      modes already on the screen is to clear to end of line.  On a
398      per-character terminal, you must clear the area where the modes
399      are set.  On a magic cookie terminal, you must clear an area
400      containing the cookie.  See the discussion above.
401
402 `xt'
403      Flag whose presence means that the cursor cannot be positioned
404      right in front of a magic cookie, and that `se' is a command to
405      delete the next magic cookie following the cursor.  See discussion
406      above.
407
408 `mb'
409      String of commands to enter blinking mode.
410
411 `md'
412      String of commands to enter double-bright mode.
413
414 `mh'
415      String of commands to enter half-bright mode.
416
417 `mk'
418      String of commands to enter invisible mode.
419
420 `mp'
421      String of commands to enter protected mode.
422
423 `mr'
424      String of commands to enter reverse-video mode.
425
426 `me'
427      String of commands to turn off all appearance modes, including
428      standout mode and underline mode.  On some terminals it also turns
429      off alternate character set mode; on others, it may not.  This
430      capability must be present if any of `mb' ... `mr' is present.
431
432 `as'
433      String of commands to turn on alternate character set mode.  This
434      mode assigns some or all graphic characters an alternate picture
435      on the screen.  There is no standard as to what the alternate
436      pictures look like.
437
438 `ae'
439      String of commands to turn off alternate character set mode.
440
441 `sa'
442      String of commands to turn on an arbitrary combination of
443      appearance modes.  It accepts 9 parameters, each of which controls
444      a particular kind of appearance mode.  A parameter should be 1 to
445      turn its appearance mode on, or zero to turn that mode off.  Most
446      terminals do not support the `sa' capability, even among those
447      that do have various appearance modes.
448
449      The nine parameters are, in order, STANDOUT, UNDERLINE, REVERSE,
450      BLINK, HALF-BRIGHT, DOUBLE-BRIGHT, BLANK, PROTECT, ALT CHAR SET.
451
452 \1f
453 File: termcap.info,  Node: Underlining,  Next: Cursor Visibility,  Prev: Standout,  Up: Capabilities
454
455 Underlining
456 ===========
457
458    Underlining on most terminals is a kind of appearance mode, much like
459 standout mode.  Therefore, it may be implemented using magic cookies or
460 as a flag in the terminal whose current state affects each character
461 that is output.  *Note Standout::, for a full explanation.
462
463    The `ug' capability is a numeric capability whose presence indicates
464 that the terminal uses magic cookies for underlining.  Its value is the
465 number of character positions that a magic cookie for underlining
466 occupies; it is used for underlining just as `sg' is used for standout.
467 Aside from the simplest applications, it is impossible to use
468 underlining correctly without paying attention to the value of `ug'.
469
470 `us'
471      String of commands to turn on underline mode or to output a magic
472      cookie to start underlining.
473
474 `ue'
475      String of commands to turn off underline mode or to output a magic
476      cookie to stop underlining.
477
478 `ug'
479      Width of magic cookie that represents a change of underline mode;
480      or missing, if the terminal does not use a magic cookie for this.
481
482 `ms'
483      Flag whose presence means that it is safe to move the cursor while
484      the appearance modes are not in the normal state.  Underlining is
485      an appearance mode.  If this flag is absent, programs should
486      always turn off underlining before moving the cursor.
487
488    There are two other, older ways of doing underlining: there can be a
489 command to underline a single character, or the output of `_', the
490 ASCII underscore character, as an overstrike could cause a character to
491 be underlined.  New programs need not bother to handle these
492 capabilities unless the author cares strongly about the obscure
493 terminals which support them.  However, terminal descriptions should
494 provide these capabilities when appropriate.
495
496 `uc'
497      String of commands to underline the character under the cursor, and
498      move the cursor right.
499
500 `ul'
501      Flag whose presence means that the terminal can underline by
502      overstriking an underscore character (`_'); some terminals can do
503      this even though they do not support overstriking in general.  An
504      implication of this flag is that when outputting new text to
505      overwrite old text, underscore characters must be treated
506      specially lest they underline the old text instead.
507
508 \1f
509 File: termcap.info,  Node: Cursor Visibility,  Next: Bell,  Prev: Underlining,  Up: Capabilities
510
511 Cursor Visibility
512 =================
513
514    Some terminals have the ability to make the cursor invisible, or to
515 enhance it.  Enhancing the cursor is often done by programs that plan
516 to use the cursor to indicate to the user a position of interest that
517 may be anywhere on the screen--for example, the Emacs editor enhances
518 the cursor on entry.  Such programs should always restore the cursor to
519 normal on exit.
520
521 `vs'
522      String of commands to enhance the cursor.
523
524 `vi'
525      String of commands to make the cursor invisible.
526
527 `ve'
528      String of commands to return the cursor to normal.
529
530    If you define either `vs' or `vi', you must also define `ve'.
531
532 \1f
533 File: termcap.info,  Node: Bell,  Next: Keypad,  Prev: Cursor Visibility,  Up: Capabilities
534
535 Bell
536 ====
537
538    Here we describe commands to make the terminal ask for the user to
539 pay attention to it.
540
541 `bl'
542      String of commands to cause the terminal to make an audible sound.
543      If this capability is absent, the terminal has no way to make a
544      suitable sound.
545
546 `vb'
547      String of commands to cause the screen to flash to attract
548      attention ("visible bell").  If this capability is absent, the
549      terminal has no way to do such a thing.
550
551 \1f
552 File: termcap.info,  Node: Keypad,  Next: Meta Key,  Prev: Bell,  Up: Capabilities
553
554 Keypad and Function Keys
555 ========================
556
557    Many terminals have arrow and function keys that transmit specific
558 character sequences to the computer.  Since the precise sequences used
559 depend on the terminal, termcap defines capabilities used to say what
560 the sequences are.  Unlike most termcap string-valued capabilities,
561 these are not strings of commands to be sent to the terminal, rather
562 strings that are received from the terminal.
563
564    Programs that expect to use keypad keys should check, initially, for
565 a `ks' capability and send it, to make the keypad actually transmit.
566 Such programs should also send the `ke' string when exiting.
567
568 `ks'
569      String of commands to make the keypad keys transmit.  If this
570      capability is not provided, but the others in this section are,
571      programs may assume that the keypad keys always transmit.
572
573 `ke'
574      String of commands to make the keypad keys work locally.  This
575      capability is provided only if `ks' is.
576
577 `kl'
578      String of input characters sent by typing the left-arrow key.  If
579      this capability is missing, you cannot expect the terminal to have
580      a left-arrow key that transmits anything to the computer.
581
582 `kr'
583      String of input characters sent by typing the right-arrow key.
584
585 `ku'
586      String of input characters sent by typing the up-arrow key.
587
588 `kd'
589      String of input characters sent by typing the down-arrow key.
590
591 `kh'
592      String of input characters sent by typing the "home-position" key.
593
594 `K1' ... `K5'
595      Strings of input characters sent by the five other keys in a 3-by-3
596      array that includes the arrow keys, if the keyboard has such a
597      3-by-3 array.  Note that one of these keys may be the
598      "home-position" key, in which case one of these capabilities will
599      have the same value as the `kh' key.
600
601 `k0'
602      String of input characters sent by function key 10 (or 0, if the
603      terminal has one labeled 0).
604
605 `k1' ... `k9'
606      Strings of input characters sent by function keys 1 through 9,
607      provided for those function keys that exist.
608
609 `kn'
610      Number: the number of numbered function keys, if there are more
611      than 10.
612
613 `l0' ... `l9'
614      Strings which are the labels appearing on the keyboard on the keys
615      described by the capabilities `k0' ... `l9'.  These capabilities
616      should be left undefined if the labels are `f0' or `f10' and `f1'
617      ... `f9'.
618
619 `kH'
620      String of input characters sent by the "home down" key, if there is
621      one.
622
623 `kb'
624      String of input characters sent by the "backspace" key, if there is
625      one.
626
627 `ka'
628      String of input characters sent by the "clear all tabs" key, if
629      there is one.
630
631 `kt'
632      String of input characters sent by the "clear tab stop this column"
633      key, if there is one.
634
635 `kC'
636      String of input characters sent by the "clear screen" key, if
637      there is one.
638
639 `kD'
640      String of input characters sent by the "delete character" key, if
641      there is one.
642
643 `kL'
644      String of input characters sent by the "delete line" key, if there
645      is one.
646
647 `kM'
648      String of input characters sent by the "exit insert mode" key, if
649      there is one.
650
651 `kE'
652      String of input characters sent by the "clear to end of line" key,
653      if there is one.
654
655 `kS'
656      String of input characters sent by the "clear to end of screen"
657      key, if there is one.
658
659 `kI'
660      String of input characters sent by the "insert character" or "enter
661      insert mode" key, if there is one.
662
663 `kA'
664      String of input characters sent by the "insert line" key, if there
665      is one.
666
667 `kN'
668      String of input characters sent by the "next page" key, if there is
669      one.
670
671 `kP'
672      String of input characters sent by the "previous page" key, if
673      there is one.
674
675 `kF'
676      String of input characters sent by the "scroll forward" key, if
677      there is one.
678
679 `kR'
680      String of input characters sent by the "scroll reverse" key, if
681      there is one.
682
683 `kT'
684      String of input characters sent by the "set tab stop in this
685      column" key, if there is one.
686
687 `ko'
688      String listing the other function keys the terminal has.  This is a
689      very obsolete way of describing the same information found in the
690      `kH' ... `kT' keys.  The string contains a list of two-character
691      termcap capability names, separated by commas.  The meaning is
692      that for each capability name listed, the terminal has a key which
693      sends the string which is the value of that capability.  For
694      example, the value `:ko=cl,ll,sf,sr:' says that the terminal has
695      four function keys which mean "clear screen", "home down", "scroll
696      forward" and "scroll reverse".
697
698 \1f
699 File: termcap.info,  Node: Meta Key,  Next: Initialization,  Prev: Keypad,  Up: Capabilities
700
701 Meta Key
702 ========
703
704    A Meta key is a key on the keyboard that modifies each character you
705 type by controlling the 0200 bit.  This bit is on if and only if the
706 Meta key is held down when the character is typed.  Characters typed
707 using the Meta key are called Meta characters.  Emacs uses Meta
708 characters as editing commands.
709
710 `km'
711      Flag whose presence means that the terminal has a Meta key.
712
713 `mm'
714      String of commands to enable the functioning of the Meta key.
715
716 `mo'
717      String of commands to disable the functioning of the Meta key.
718
719    If the terminal has `km' but does not have `mm' and `mo', it means
720 that the Meta key always functions.  If it has `mm' and `mo', it means
721 that the Meta key can be turned on or off.  Send the `mm' string to
722 turn it on, and the `mo' string to turn it off.  I do not know why one
723 would ever not want it to be on.
724
725 \1f
726 File: termcap.info,  Node: Initialization,  Next: Pad Specs,  Prev: Meta Key,  Up: Capabilities
727
728 Initialization
729 ==============
730
731 `ti'
732      String of commands to put the terminal into whatever special modes
733      are needed or appropriate for programs that move the cursor
734      nonsequentially around the screen.  Programs that use termcap to do
735      full-screen display should output this string when they start up.
736
737 `te'
738      String of commands to undo what is done by the `ti' string.
739      Programs that output the `ti' string on entry should output this
740      string when they exit.
741
742 `is'
743      String of commands to initialize the terminal for each login
744      session.
745
746 `if'
747      String which is the name of a file containing the string of
748      commands to initialize the terminal for each session of use.
749      Normally `is' and `if' are not both used.
750
751 `i1'
752 `i3'
753      Two more strings of commands to initialize the terminal for each
754      login session.  The `i1' string (if defined) is output before `is'
755      or `if', and the `i3' string (if defined) is output after.
756
757      The reason for having three separate initialization strings is to
758      make it easier to define a group of related terminal types with
759      slightly different initializations.  Define two or three of the
760      strings in the basic type; then the other types can override one
761      or two of the strings.
762
763 `rs'
764      String of commands to reset the terminal from any strange mode it
765      may be in.  Normally this includes the `is' string (or other
766      commands with the same effects) and more.  What would go in the
767      `rs' string but not in the `is' string are annoying or slow
768      commands to bring the terminal back from strange modes that nobody
769      would normally use.
770
771 `it'
772      Numeric value, the initial spacing between hardware tab stop
773      columns when the terminal is powered up.  Programs to initialize
774      the terminal can use this to decide whether there is a need to set
775      the tab stops.  If the initial width is 8, well and good; if it is
776      not 8, then the tab stops should be set; if they cannot be set,
777      the kernel is told to convert tabs to spaces, and other programs
778      will observe this and do likewise.
779
780 `ct'
781      String of commands to clear all tab stops.
782
783 `st'
784      String of commands to set tab stop at current cursor column on all
785      lines.
786
787 `NF'
788      Flag whose presence means that the terminal does not support
789      XON/XOFF flow control.  Programs should not send XON (`C-q') or
790      XOFF (`C-s') characters to the terminal.
791
792 \1f
793 File: termcap.info,  Node: Pad Specs,  Next: Status Line,  Prev: Initialization,  Up: Capabilities
794
795 Padding Capabilities
796 ====================
797
798    There are two terminal capabilities that exist just to explain the
799 proper way to obey the padding specifications in all the command string
800 capabilities.  One, `pc', must be obeyed by all termcap-using programs.
801
802 `pb'
803      Numeric value, the lowest baud rate at which padding is actually
804      needed.  Programs may check this and refrain from doing any
805      padding at lower speeds.
806
807 `pc'
808      String of commands for padding.  The first character of this
809      string is to be used as the pad character, instead of using null
810      characters for padding.  If `pc' is not provided, use null
811      characters.  Every program that uses termcap must look up this
812      capability and use it to set the variable `PC' that is used by
813      `tputs'.  *Note Padding::.
814
815    Some termcap capabilities exist just to specify the amount of
816 padding that the kernel should give to cursor motion commands used in
817 ordinary sequential output.
818
819 `dC'
820      Numeric value, the number of msec of padding needed for the
821      carriage-return character.
822
823 `dN'
824      Numeric value, the number of msec of padding needed for the newline
825      (linefeed) character.
826
827 `dB'
828      Numeric value, the number of msec of padding needed for the
829      backspace character.
830
831 `dF'
832      Numeric value, the number of msec of padding needed for the
833      formfeed character.
834
835 `dT'
836      Numeric value, the number of msec of padding needed for the tab
837      character.
838
839    In some systems, the kernel uses the above capabilities; in other
840 systems, the kernel uses the paddings specified in the string
841 capabilities `cr', `sf', `le', `ff' and `ta'.  Descriptions of
842 terminals which require such padding should contain the `dC' ...  `dT'
843 capabilities and also specify the appropriate padding in the
844 corresponding string capabilities.  Since no modern terminals require
845 padding for ordinary sequential output, you probably won't need to do
846 either of these things.
847
848 \1f
849 File: termcap.info,  Node: Status Line,  Next: Half-Line,  Prev: Pad Specs,  Up: Capabilities
850
851 Status Line
852 ===========
853
854    A "status line" is a line on the terminal that is not used for
855 ordinary display output but instead used for a special message.  The
856 intended use is for a continuously updated description of what the
857 user's program is doing, and that is where the name "status line" comes
858 from, but in fact it could be used for anything.  The distinguishing
859 characteristic of a status line is that ordinary output to the terminal
860 does not affect it; it changes only if the special status line commands
861 of this section are used.
862
863 `hs'
864      Flag whose presence means that the terminal has a status line.  If
865      a terminal description specifies that there is a status line, it
866      must provide the `ts' and `fs' capabilities.
867
868 `ts'
869      String of commands to move the terminal cursor into the status
870      line.  Usually these commands must specifically record the old
871      cursor position for the sake of the `fs' string.
872
873 `fs'
874      String of commands to move the cursor back from the status line to
875      its previous position (outside the status line).
876
877 `es'
878      Flag whose presence means that other display commands work while
879      writing the status line.  In other words, one can clear parts of
880      it, insert or delete characters, move the cursor within it using
881      `ch' if there is a `ch' capability, enter and leave standout mode,
882      and so on.
883
884 `ds'
885      String of commands to disable the display of the status line.  This
886      may be absent, if there is no way to disable the status line
887      display.
888
889 `ws'
890      Numeric value, the width of the status line.  If this capability is
891      absent in a terminal that has a status line, it means the status
892      line is the same width as the other lines.
893
894      Note that the value of `ws' is sometimes as small as 8.
895
896 \1f
897 File: termcap.info,  Node: Half-Line,  Next: Printer,  Prev: Status Line,  Up: Capabilities
898
899 Half-Line Motion
900 ================
901
902    Some terminals have commands for moving the cursor vertically by
903 half-lines, useful for outputting subscripts and superscripts.  Mostly
904 it is hardcopy terminals that have such features.
905
906 `hu'
907      String of commands to move the cursor up half a line.  If the
908      terminal is a display, it is your responsibility to avoid moving
909      up past the top line; however, most likely the terminal that
910      supports this is a hardcopy terminal and there is nothing to be
911      concerned about.
912
913 `hd'
914      String of commands to move the cursor down half a line.  If the
915      terminal is a display, it is your responsibility to avoid moving
916      down past the bottom line, etc.
917
918 \1f
919 File: termcap.info,  Node: Printer,  Prev: Half-Line,  Up: Capabilities
920
921 Controlling Printers Attached to Terminals
922 ==========================================
923
924    Some terminals have attached hardcopy printer ports.  They may be
925 able to copy the screen contents to the printer; they may also be able
926 to redirect output to the printer.  Termcap does not have anything to
927 tell the program whether the redirected output appears also on the
928 screen; it does on some terminals but not all.
929
930 `ps'
931      String of commands to cause the contents of the screen to be
932      printed.  If it is absent, the screen contents cannot be printed.
933
934 `po'
935      String of commands to redirect further output to the printer.
936
937 `pf'
938      String of commands to terminate redirection of output to the
939      printer.  This capability must be present in the description if
940      `po' is.
941
942 `pO'
943      String of commands to redirect output to the printer for next N
944      characters of output, regardless of what they are.  Redirection
945      will end automatically after N characters of further output.  Until
946      then, nothing that is output can end redirection, not even the
947      `pf' string if there is one.  The number N should not be more than
948      255.
949
950      One use of this capability is to send non-text byte sequences
951      (such as bit-maps) to the printer.
952
953    Most terminals with printers do not support all of `ps', `po' and
954 `pO'; any one or two of them may be supported.  To make a program that
955 can send output to all kinds of printers, it is necessary to check for
956 all three of these capabilities, choose the most convenient of the ones
957 that are provided, and use it in its own appropriate fashion.
958
959 \1f
960 File: termcap.info,  Node: Summary,  Next: Var Index,  Prev: Capabilities,  Up: Top
961
962 Summary of Capability Names
963 ***************************
964
965    Here are all the terminal capability names in alphabetical order
966 with a brief description of each.  For cross references to their
967 definitions, see the index of capability names (*note Cap Index::.).
968
969 `ae'
970      String to turn off alternate character set mode.
971
972 `al'
973      String to insert a blank line before the cursor.
974
975 `AL'
976      String to insert N blank lines before the cursor.
977
978 `am'
979      Flag: output to last column wraps cursor to next line.
980
981 `as'
982      String to turn on alternate character set mode.like.
983
984 `bc'
985      Very obsolete alternative name for the `le' capability.
986
987 `bl'
988      String to sound the bell.
989
990 `bs'
991      Obsolete flag: ASCII backspace may be used for leftward motion.
992
993 `bt'
994      String to move the cursor left to the previous hardware tab stop
995      column.
996
997 `bw'
998      Flag: `le' at left margin wraps to end of previous line.
999
1000 `CC'
1001      String to change terminal's command character.
1002
1003 `cd'
1004      String to clear the line the cursor is on, and following lines.
1005
1006 `ce'
1007      String to clear from the cursor to the end of the line.
1008
1009 `ch'
1010      String to position the cursor at column C in the same line.
1011
1012 `cl'
1013      String to clear the entire screen and put cursor at upper left
1014      corner.
1015
1016 `cm'
1017      String to position the cursor at line L, column C.
1018
1019 `CM'
1020      String to position the cursor at line L, column C, relative to
1021      display memory.
1022
1023 `co'
1024      Number: width of the screen.
1025
1026 `cr'
1027      String to move cursor sideways to left margin.
1028
1029 `cs'
1030      String to set the scroll region.
1031
1032 `cS'
1033      Alternate form of string to set the scroll region.
1034
1035 `ct'
1036      String to clear all tab stops.
1037
1038 `cv'
1039      String to position the cursor at line L in the same column.
1040
1041 `da'
1042      Flag: data scrolled off top of screen may be scrolled back.
1043
1044 `db'
1045      Flag: data scrolled off bottom of screen may be scrolled back.
1046
1047 `dB'
1048      Obsolete number: msec of padding needed for the backspace
1049      character.
1050
1051 `dc'
1052      String to delete one character position at the cursor.
1053
1054 `dC'
1055      Obsolete number: msec of padding needed for the carriage-return
1056      character.
1057
1058 `DC'
1059      String to delete N characters starting at the cursor.
1060
1061 `dF'
1062      Obsolete number: msec of padding needed for the formfeed character.
1063
1064 `dl'
1065      String to delete the line the cursor is on.
1066
1067 `DL'
1068      String to delete N lines starting with the cursor's line.
1069
1070 `dm'
1071      String to enter delete mode.
1072
1073 `dN'
1074      Obsolete number: msec of padding needed for the newline character.
1075
1076 `do'
1077      String to move the cursor vertically down one line.
1078
1079 `DO'
1080      String to move cursor vertically down N lines.
1081
1082 `ds'
1083      String to disable the display of the status line.
1084
1085 `dT'
1086      Obsolete number: msec of padding needed for the tab character.
1087
1088 `ec'
1089      String of commands to clear N characters at cursor.
1090
1091 `ed'
1092      String to exit delete mode.
1093
1094 `ei'
1095      String to leave insert mode.
1096
1097 `eo'
1098      Flag: output of a space can erase an overstrike.
1099
1100 `es'
1101      Flag: other display commands work while writing the status line.
1102
1103 `ff'
1104      String to advance to the next page, for a hardcopy terminal.
1105
1106 `fs'
1107      String to move the cursor back from the status line to its
1108      previous position (outside the status line).
1109
1110 `gn'
1111      Flag: this terminal type is generic, not real.
1112
1113 `hc'
1114      Flag: hardcopy terminal.
1115
1116 `hd'
1117      String to move the cursor down half a line.
1118
1119 `ho'
1120      String to position cursor at upper left corner.
1121
1122 `hs'
1123      Flag: the terminal has a status line.
1124
1125 `hu'
1126      String to move the cursor up half a line.
1127
1128 `hz'
1129      Flag: terminal cannot accept `~' as output.
1130
1131 `i1'
1132      String to initialize the terminal for each login session.
1133
1134 `i3'
1135      String to initialize the terminal for each login session.
1136
1137 `ic'
1138      String to insert one character position at the cursor.
1139
1140 `IC'
1141      String to insert N character positions at the cursor.
1142
1143 `if'
1144      String naming a file of commands to initialize the terminal.
1145
1146 `im'
1147      String to enter insert mode.
1148
1149 `in'
1150      Flag: outputting a space is different from moving over empty
1151      positions.
1152
1153 `ip'
1154      String to output following an inserted character in insert mode.
1155
1156 `is'
1157      String to initialize the terminal for each login session.
1158
1159 `it'
1160      Number: initial spacing between hardware tab stop columns.
1161
1162 `k0'
1163      String of input sent by function key 0 or 10.
1164
1165 `k1 ... k9'
1166      Strings of input sent by function keys 1 through 9.
1167
1168 `K1 ... K5'
1169      Strings sent by the five other keys in 3-by-3 array with arrows.
1170
1171 `ka'
1172      String of input sent by the "clear all tabs" key.
1173
1174 `kA'
1175      String of input sent by the "insert line" key.
1176
1177 `kb'
1178      String of input sent by the "backspace" key.
1179
1180 `kC'
1181      String of input sent by the "clear screen" key.
1182
1183 `kd'
1184      String of input sent by typing the down-arrow key.
1185
1186 `kD'
1187      String of input sent by the "delete character" key.
1188
1189 `ke'
1190      String to make the function keys work locally.
1191
1192 `kE'
1193      String of input sent by the "clear to end of line" key.
1194
1195 `kF'
1196      String of input sent by the "scroll forward" key.
1197
1198 `kh'
1199      String of input sent by typing the "home-position" key.
1200
1201 `kH'
1202      String of input sent by the "home down" key.
1203
1204 `kI'
1205      String of input sent by the "insert character" or "enter insert
1206      mode" key.
1207
1208 `kl'
1209      String of input sent by typing the left-arrow key.
1210
1211 `kL'
1212      String of input sent by the "delete line" key.
1213
1214 `km'
1215      Flag: the terminal has a Meta key.
1216
1217 `kM'
1218      String of input sent by the "exit insert mode" key.
1219
1220 `kn'
1221      Numeric value, the number of numbered function keys.
1222
1223 `kN'
1224      String of input sent by the "next page" key.
1225
1226 `ko'
1227      Very obsolete string listing the terminal's named function keys.
1228
1229 `kP'
1230      String of input sent by the "previous page" key.
1231
1232 `kr'
1233      String of input sent by typing the right-arrow key.
1234
1235 `kR'
1236      String of input sent by the "scroll reverse" key.
1237
1238 `ks'
1239      String to make the function keys transmit.
1240
1241 `kS'
1242      String of input sent by the "clear to end of screen" key.
1243
1244 `kt'
1245      String of input sent by the "clear tab stop this column" key.
1246
1247 `kT'
1248      String of input sent by the "set tab stop in this column" key.
1249
1250 `ku'
1251      String of input sent by typing the up-arrow key.
1252
1253 `l0'
1254      String on keyboard labelling function key 0 or 10.
1255
1256 `l1 ... l9'
1257      Strings on keyboard labelling function keys 1 through 9.
1258
1259 `le'
1260      String to move the cursor left one column.
1261
1262 `LE'
1263      String to move cursor left N columns.
1264
1265 `li'
1266      Number: height of the screen.
1267
1268 `ll'
1269      String to position cursor at lower left corner.
1270
1271 `lm'
1272      Number: lines of display memory.
1273
1274 `LP'
1275      Flag: writing to last column of last line will not scroll.
1276
1277 `mb'
1278      String to enter blinking mode.
1279
1280 `md'
1281      String to enter double-bright mode.
1282
1283 `me'
1284      String to turn off all appearance modes
1285
1286 `mh'
1287      String to enter half-bright mode.
1288
1289 `mi'
1290      Flag: cursor motion in insert mode is safe.
1291
1292 `mk'
1293      String to enter invisible mode.
1294
1295 `mm'
1296      String to enable the functioning of the Meta key.
1297
1298 `mo'
1299      String to disable the functioning of the Meta key.
1300
1301 `mp'
1302      String to enter protected mode.
1303
1304 `mr'
1305      String to enter reverse-video mode.
1306
1307 `ms'
1308      Flag: cursor motion in standout mode is safe.
1309
1310 `nc'
1311      Obsolete flag: do not use ASCII carriage-return on this terminal.
1312
1313 `nd'
1314      String to move the cursor right one column.
1315
1316 `NF'
1317      Flag: do not use XON/XOFF flow control.
1318
1319 `nl'
1320      Obsolete alternative name for the `do' and `sf' capabilities.
1321
1322 `ns'
1323      Flag: the terminal does not normally scroll for sequential output.
1324
1325 `nw'
1326      String to move to start of next line, possibly clearing rest of
1327      old line.
1328
1329 `os'
1330      Flag: terminal can overstrike.
1331
1332 `pb'
1333      Number: the lowest baud rate at which padding is actually needed.
1334
1335 `pc'
1336      String containing character for padding.
1337
1338 `pf'
1339      String to terminate redirection of output to the printer.
1340
1341 `po'
1342      String to redirect further output to the printer.
1343
1344 `pO'
1345      String to redirect N characters ofoutput to the printer.
1346
1347 `ps'
1348      String to print the screen on the attached printer.
1349
1350 `rc'
1351      String to move to last saved cursor position.
1352
1353 `RI'
1354      String to move cursor right N columns.
1355
1356 `rp'
1357      String to output character C repeated N times.
1358
1359 `rs'
1360      String to reset the terminal from any strange modes.
1361
1362 `sa'
1363      String to turn on an arbitrary combination of appearance modes.
1364
1365 `sc'
1366      String to save the current cursor position.
1367
1368 `se'
1369      String to leave standout mode.
1370
1371 `sf'
1372      String to scroll the screen one line up.
1373
1374 `SF'
1375      String to scroll the screen N lines up.
1376
1377 `sg'
1378      Number: width of magic standout cookie.  Absent if magic cookies
1379      are not used.
1380
1381 `so'
1382      String to enter standout mode.
1383
1384 `sr'
1385      String to scroll the screen one line down.
1386
1387 `SR'
1388      String to scroll the screen N line down.
1389
1390 `st'
1391      String to set tab stop at current cursor column on all lines.
1392      programs.
1393
1394 `ta'
1395      String to move the cursor right to the next hardware tab stop
1396      column.
1397
1398 `te'
1399      String to return terminal to settings for sequential output.
1400
1401 `ti'
1402      String to initialize terminal for random cursor motion.
1403
1404 `ts'
1405      String to move the terminal cursor into the status line.
1406
1407 `uc'
1408      String to underline one character and move cursor right.
1409
1410 `ue'
1411      String to turn off underline mode
1412
1413 `ug'
1414      Number: width of underlining magic cookie.  Absent if underlining
1415      doesn't use magic cookies.
1416
1417 `ul'
1418      Flag: underline by overstriking with an underscore.
1419
1420 `up'
1421      String to move the cursor vertically up one line.
1422
1423 `UP'
1424      String to move cursor vertically up N lines.
1425
1426 `us'
1427      String to turn on underline mode
1428
1429 `vb'
1430      String to make the screen flash.
1431
1432 `ve'
1433      String to return the cursor to normal.
1434
1435 `vi'
1436      String to make the cursor invisible.
1437
1438 `vs'
1439      String to enhance the cursor.
1440
1441 `wi'
1442      String to set the terminal output screen window.
1443
1444 `ws'
1445      Number: the width of the status line.
1446
1447 `xb'
1448      Flag: superbee terminal.
1449
1450 `xn'
1451      Flag: cursor wraps in a strange way.
1452
1453 `xs'
1454      Flag: clearing a line is the only way to clear the appearance
1455      modes of positions in that line (or, only way to remove magic
1456      cookies on that line).
1457
1458 `xt'
1459      Flag: Teleray 1061; several strange characteristics.
1460
1461 \1f
1462 File: termcap.info,  Node: Var Index,  Next: Cap Index,  Prev: Summary,  Up: Top
1463
1464 Variable and Function Index
1465 ***************************
1466
1467 * Menu:
1468
1469 * BC:                                   tgoto.
1470 * ospeed:                               Output Padding.
1471 * PC:                                   Output Padding.
1472 * tgetent:                              Find.
1473 * tgetflag:                             Interrogate.
1474 * tgetnum:                              Interrogate.
1475 * tgetstr:                              Interrogate.
1476 * tgoto:                                tgoto.
1477 * tparam:                               tparam.
1478 * tputs:                                Output Padding.
1479 * UP:                                   tgoto.
1480