XEmacs 21.4.19 (Constant Variable).
[chise/xemacs-chise.git.1] / info / termcap.info
1 This is ../info/termcap.info, produced by makeinfo version 4.8 from
2 termcap.texi.
3
4 START-INFO-DIR-ENTRY
5 * Termcap: (termcap).           Termcap library of the GNU system.
6 END-INFO-DIR-ENTRY
7
8    This file documents the termcap library of the GNU system.
9
10    Copyright (C) 1988 Free Software Foundation, Inc.
11
12    Permission is granted to make and distribute verbatim copies of this
13 manual provided the copyright notice and this permission notice are
14 preserved on all copies.
15
16    Permission is granted to copy and distribute modified versions of
17 this manual under the conditions for verbatim copying, provided that
18 the entire resulting derived work is distributed under the terms of a
19 permission notice identical to this one.
20
21    Permission is granted to copy and distribute translations of this
22 manual into another language, under the above conditions for modified
23 versions, except that this permission notice may be stated in a
24 translation approved by the Foundation.
25
26 \1f
27 File: termcap.info,  Node: Top,  Next: Introduction,  Prev: (DIR),  Up: (DIR)
28
29 * Menu:
30
31 * Introduction::What is termcap?  Why this manual?
32 * Library::     The termcap library functions.
33 * Data Base::   What terminal descriptions in `/etc/termcap' look like.
34 * Capabilities::Definitions of the individual terminal capabilities:
35                  how to write them in descriptions, and how to use
36                  their values to do display updating.
37 * Summary::     Brief table of capability names and their meanings.
38 * Var Index::   Index of C functions and variables.
39 * Cap Index::   Index of termcap capabilities.
40 * Index::       Concept index.
41
42 \1f
43 File: termcap.info,  Node: Introduction,  Next: Library,  Prev: Top,  Up: Top
44
45 Introduction
46 ************
47
48 "Termcap" is a library and data base that enables programs to use
49 display terminals in a terminal-independent manner.  It originated in
50 Berkeley Unix.
51
52    The termcap data base describes the capabilities of hundreds of
53 different display terminals in great detail.  Some examples of the
54 information recorded for a terminal could include how many columns wide
55 it is, what string to send to move the cursor to an arbitrary position
56 (including how to encode the row and column numbers), how to scroll the
57 screen up one or several lines, and how much padding is needed for such
58 a scrolling operation.
59
60    The termcap library is provided for easy access this data base in
61 programs that want to do terminal-independent character-based display
62 output.
63
64    This manual describes the GNU version of the termcap library, which
65 has some extensions over the Unix version.  All the extensions are
66 identified as such, so this manual also tells you how to use the Unix
67 termcap.
68
69    The GNU version of the termcap library is available free as source
70 code, for use in free programs, and runs on Unix and VMS systems (at
71 least).  You can find it in the GNU Emacs distribution in the files
72 `termcap.c' and `tparam.c'.
73
74    This manual was written for the GNU project, whose goal is to
75 develop a complete free operating system upward-compatible with Unix
76 for user programs.  The project is approximately two thirds complete.
77 For more information on the GNU project, including the GNU Emacs editor
78 and the mostly-portable optimizing C compiler, send one dollar to
79
80      Free Software Foundation
81      675 Mass Ave
82      Cambridge, MA 02139
83
84 \1f
85 File: termcap.info,  Node: Library,  Next: Data Base,  Prev: Introduction,  Up: Top
86
87 1 The Termcap Library
88 *********************
89
90 The termcap library is the application programmer's interface to the
91 termcap data base.  It contains functions for the following purposes:
92
93    * Finding the description of the user's terminal type (`tgetent').
94
95    * Interrogating the description for information on various topics
96      (`tgetnum', `tgetflag', `tgetstr').
97
98    * Computing and performing padding (`tputs').
99
100    * Encoding numeric parameters such as cursor positions into the
101      terminal-specific form required for display commands (`tparam',
102      `tgoto').
103
104 * Menu:
105
106 * Preparation:: Preparing to use the termcap library.
107 * Find::        Finding the description of the terminal being used.
108 * Interrogate:: Interrogating the description for particular capabilities.
109 * Initialize::  Initialization for output using termcap.
110 * Padding::     Outputting padding.
111 * Parameters::  Encoding parameters such as cursor positions.
112
113 \1f
114 File: termcap.info,  Node: Preparation,  Next: Find,  Prev: Library,  Up: Library
115
116 1.1 Preparing to Use the Termcap Library
117 ========================================
118
119 To use the termcap library in a program, you need two kinds of
120 preparation:
121
122    * The compiler needs declarations of the functions and variables in
123      the library.
124
125      On GNU systems, it suffices to include the header file `termcap.h'
126      in each source file that uses these functions and variables.
127
128      On Unix systems, there is often no such header file.  Then you must
129      explictly declare the variables as external.  You can do likewise
130      for the functions, or let them be implicitly declared and cast
131      their values from type `int' to the appropriate type.
132
133      We illustrate the declarations of the individual termcap library
134      functions with ANSI C prototypes because they show how to pass the
135      arguments.  If you are not using the GNU C compiler, you probably
136      cannot use function prototypes, so omit the argument types and
137      names from your declarations.
138
139    * The linker needs to search the library.  Usually either
140      `-ltermcap' or `-ltermlib' as an argument when linking will do
141      this.
142
143 \1f
144 File: termcap.info,  Node: Find,  Next: Interrogate,  Prev: Preparation,  Up: Library
145
146 1.2 Finding a Terminal Description: `tgetent'
147 =============================================
148
149 An application program that is going to use termcap must first look up
150 the description of the terminal type in use.  This is done by calling
151 `tgetent', whose declaration in ANSI Standard C looks like:
152
153      int tgetent (char *BUFFER, char *TERMTYPE);
154
155 This function finds the description and remembers it internally so that
156 you can interrogate it about specific terminal capabilities (*note
157 Interrogate::).
158
159    The argument TERMTYPE is a string which is the name for the type of
160 terminal to look up.  Usually you would obtain this from the environment
161 variable `TERM' using `getenv ("TERM")'.
162
163    If you are using the GNU version of termcap, you can alternatively
164 ask `tgetent' to allocate enough space.  Pass a null pointer for
165 BUFFER, and `tgetent' itself allocates the storage using `malloc'.  In
166 this case the returned value on success is the address of the storage,
167 cast to `int'.  But normally there is no need for you to look at the
168 address.  Do not free the storage yourself.
169
170    With the Unix version of termcap, you must allocate space for the
171 description yourself and pass the address of the space as the argument
172 BUFFER.  There is no way you can tell how much space is needed, so the
173 convention is to allocate a buffer 2048 characters long and assume that
174 is enough.  (Formerly the convention was to allocate 1024 characters and
175 assume that was enough.  But one day, for one kind of terminal, that was
176 not enough.)
177
178    No matter how the space to store the description has been obtained,
179 termcap records its address internally for use when you later
180 interrogate the description with `tgetnum', `tgetstr' or `tgetflag'.  If
181 the buffer was allocated by termcap, it will be freed by termcap too if
182 you call `tgetent' again.  If the buffer was provided by you, you must
183 make sure that its contents remain unchanged for as long as you still
184 plan to interrogate the description.
185
186    The return value of `tgetent' is -1 if there is some difficulty
187 accessing the data base of terminal types, 0 if the data base is
188 accessible but the specified type is not defined in it, and some other
189 value otherwise.
190
191    Here is how you might use the function `tgetent':
192
193      #ifdef unix
194      static char term_buffer[2048];
195      #else
196      #define term_buffer 0
197      #endif
198
199      init_terminal_data ()
200      {
201        char *termtype = getenv ("TERM");
202        int success;
203
204        if (termtype == 0)
205          fatal ("Specify a terminal type with `setenv TERM <yourtype>'.\n");
206
207        success = tgetent (term_buffer, termtype);
208        if (success < 0)
209          fatal ("Could not access the termcap data base.\n");
210        if (success == 0)
211          fatal ("Terminal type `%s' is not defined.\n", termtype);
212      }
213
214 Here we assume the function `fatal' prints an error message and exits.
215
216    If the environment variable `TERMCAP' is defined, its value is used
217 to override the terminal type data base.  The function `tgetent' checks
218 the value of `TERMCAP' automatically.  If the value starts with `/'
219 then it is taken as a file name to use as the data base file, instead
220 of `/etc/termcap' which is the standard data base.  If the value does
221 not start with `/' then it is itself used as the terminal description,
222 provided that the terminal type TERMTYPE is among the types it claims
223 to apply to.  *Note Data Base::, for information on the format of a
224 terminal description.
225
226 \1f
227 File: termcap.info,  Node: Interrogate,  Next: Initialize,  Prev: Find,  Up: Library
228
229 1.3 Interrogating the Terminal Description
230 ==========================================
231
232 Each piece of information recorded in a terminal description is called a
233 "capability".  Each defined terminal capability has a two-letter code
234 name and a specific meaning.  For example, the number of columns is
235 named `co'.  *Note Capabilities::, for definitions of all the standard
236 capability names.
237
238    Once you have found the proper terminal description with `tgetent'
239 (*note Find::), your application program must "interrogate" it for
240 various terminal capabilities.  You must specify the two-letter code of
241 the capability whose value you seek.
242
243    Capability values can be numeric, boolean (capability is either
244 present or absent) or strings.  Any particular capability always has
245 the same value type; for example, `co' always has a numeric value,
246 while `am' (automatic wrap at margin) is always a flag, and `cm'
247 (cursor motion command) always has a string value.  The documentation
248 of each capability says which type of value it has.
249
250    There are three functions to use to get the value of a capability,
251 depending on the type of value the capability has.  Here are their
252 declarations in ANSI C:
253
254      int tgetnum (char *NAME);
255      int tgetflag (char *NAME);
256      char *tgetstr (char *NAME, char **AREA);
257
258 `tgetnum'
259      Use `tgetnum' to get a capability value that is numeric.  The
260      argument NAME is the two-letter code name of the capability.  If
261      the capability is present, `tgetnum' returns the numeric value
262      (which is nonnegative).  If the capability is not mentioned in the
263      terminal description, `tgetnum' returns -1.
264
265 `tgetflag'
266      Use `tgetflag' to get a boolean value.  If the capability NAME is
267      present in the terminal description, `tgetflag' returns 1;
268      otherwise, it returns 0.
269
270 `tgetstr'
271      Use `tgetstr' to get a string value.  It returns a pointer to a
272      string which is the capability value, or a null pointer if the
273      capability is not present in the terminal description.
274
275      There are two ways `tgetstr' can find space to store the string
276      value:
277
278         * You can ask `tgetstr' to allocate the space.  Pass a null
279           pointer for the argument AREA, and `tgetstr' will use
280           `malloc' to allocate storage big enough for the value.
281           Termcap will never free this storage or refer to it again; you
282           should free it when you are finished with it.
283
284           This method is more robust, since there is no need to guess
285           how much space is needed.  But it is supported only by the GNU
286           termcap library.
287
288         * You can provide the space.  Provide for the argument AREA the
289           address of a pointer variable of type `char *'.  Before
290           calling `tgetstr', initialize the variable to point at
291           available space.  Then `tgetstr' will store the string value
292           in that space and will increment the pointer variable to
293           point after the space that has been used.  You can use the
294           same pointer variable for many calls to `tgetstr'.
295
296           There is no way to determine how much space is needed for a
297           single string, and no way for you to prevent or handle
298           overflow of the area you have provided.  However, you can be
299           sure that the total size of all the string values you will
300           obtain from the terminal description is no greater than the
301           size of the description (unless you get the same capability
302           twice).  You can determine that size with `strlen' on the
303           buffer you provided to `tgetent'.  See below for an example.
304
305           Providing the space yourself is the only method supported by
306           the Unix version of termcap.
307
308    Note that you do not have to specify a terminal type or terminal
309 description for the interrogation functions.  They automatically use the
310 description found by the most recent call to `tgetent'.
311
312    Here is an example of interrogating a terminal description for
313 various capabilities, with conditionals to select between the Unix and
314 GNU methods of providing buffer space.
315
316      char *tgetstr ();
317
318      char *cl_string, *cm_string;
319      int height;
320      int width;
321      int auto_wrap;
322
323      char PC;   /* For tputs.  */
324      char *BC;  /* For tgoto.  */
325      char *UP;
326
327      interrogate_terminal ()
328      {
329      #ifdef UNIX
330        /* Here we assume that an explicit term_buffer
331           was provided to tgetent.  */
332        char *buffer
333          = (char *) malloc (strlen (term_buffer));
334      #define BUFFADDR &buffer
335      #else
336      #define BUFFADDR 0
337      #endif
338
339        char *temp;
340
341        /* Extract information we will use.  */
342        cl_string = tgetstr ("cl", BUFFADDR);
343        cm_string = tgetstr ("cm", BUFFADDR);
344        auto_wrap = tgetflag ("am");
345        height = tgetnum ("li");
346        width = tgetnum ("co");
347
348        /* Extract information that termcap functions use.  */
349        temp = tgetstr ("pc", BUFFADDR);
350        PC = temp ? *temp : 0;
351        BC = tgetstr ("le", BUFFADDR);
352        UP = tgetstr ("up", BUFFADDR);
353      }
354
355 *Note Padding::, for information on the variable `PC'.  *Note Using
356 Parameters::, for information on `UP' and `BC'.
357
358 \1f
359 File: termcap.info,  Node: Initialize,  Next: Padding,  Prev: Interrogate,  Up: Library
360
361 1.4 Initialization for Use of Termcap
362 =====================================
363
364 Before starting to output commands to a terminal using termcap, an
365 application program should do two things:
366
367    * Initialize various global variables which termcap library output
368      functions refer to.  These include `PC' and `ospeed' for padding
369      (*note Output Padding::) and `UP' and `BC' for cursor motion
370      (*note tgoto::).
371
372    * Tell the kernel to turn off alteration and padding of
373      horizontal-tab characters sent to the terminal.
374
375    To turn off output processing in Berkeley Unix you would use `ioctl'
376 with code `TIOCLSET' to set the bit named `LLITOUT', and clear the bits
377 `ANYDELAY' using `TIOCSETN'.  In POSIX or System V, you must clear the
378 bit named `OPOST'.  Refer to the system documentation for details.
379
380    If you do not set the terminal flags properly, some older terminals
381 will not work.  This is because their commands may contain the
382 characters that normally signify newline, carriage return and
383 horizontal tab--characters which the kernel thinks it ought to modify
384 before output.
385
386    When you change the kernel's terminal flags, you must arrange to
387 restore them to their normal state when your program exits.  This
388 implies that the program must catch fatal signals such as `SIGQUIT' and
389 `SIGINT' and restore the old terminal flags before actually terminating.
390
391    Modern terminals' commands do not use these special characters, so
392 if you do not care about problems with old terminals, you can leave the
393 kernel's terminal flags unaltered.
394
395 \1f
396 File: termcap.info,  Node: Padding,  Next: Parameters,  Prev: Initialize,  Up: Library
397
398 1.5 Padding
399 ===========
400
401 "Padding" means outputting null characters following a terminal display
402 command that takes a long time to execute.  The terminal description
403 says which commands require padding and how much; the function `tputs',
404 described below, outputs a terminal command while extracting from it the
405 padding information, and then outputs the padding that is necessary.
406
407 * Menu:
408
409 * Why Pad::          Explanation of padding.
410 * Describe Padding:: The data base says how much padding a terminal needs.
411 * Output Padding::   Using `tputs' to output the needed padding.
412
413 \1f
414 File: termcap.info,  Node: Why Pad,  Next: Describe Padding,  Prev: Padding,  Up: Padding
415
416 1.5.1 Why Pad, and How
417 ----------------------
418
419 Most types of terminal have commands that take longer to execute than
420 they do to send over a high-speed line.  For example, clearing the
421 screen may take 20msec once the entire command is received.  During
422 that time, on a 9600 bps line, the terminal could receive about 20
423 additional output characters while still busy clearing the screen.
424 Every terminal has a certain amount of buffering capacity to remember
425 output characters that cannot be processed yet, but too many slow
426 commands in a row can cause the buffer to fill up.  Then any additional
427 output that cannot be processed immediately will be lost.
428
429    To avoid this problem, we normally follow each display command with
430 enough useless charaters (usually null characters) to fill up the time
431 that the display command needs to execute.  This does the job if the
432 terminal throws away null characters without using up space in the
433 buffer (which most terminals do).  If enough padding is used, no output
434 can ever be lost.  The right amount of padding avoids loss of output
435 without slowing down operation, since the time used to transmit padding
436 is time that nothing else could be done.
437
438    The number of padding characters needed for an operation depends on
439 the line speed.  In fact, it is proportional to the line speed.  A 9600
440 baud line transmits about one character per msec, so the clear screen
441 command in the example above would need about 20 characters of padding.
442 At 1200 baud, however, only about 3 characters of padding are needed
443 to fill up 20msec.
444
445 \1f
446 File: termcap.info,  Node: Describe Padding,  Next: Output Padding,  Prev: Why Pad,  Up: Padding
447
448 1.5.2 Specifying Padding in a Terminal Description
449 --------------------------------------------------
450
451 In the terminal description, the amount of padding required by each
452 display command is recorded as a sequence of digits at the front of the
453 command.  These digits specify the padding time in msec.  They can be
454 followed optionally by a decimal point and one more digit, which is a
455 number of tenths of msec.
456
457    Sometimes the padding needed by a command depends on the cursor
458 position.  For example, the time taken by an "insert line" command is
459 usually proportional to the number of lines that need to be moved down
460 or cleared.  An asterisk (`*') following the padding time says that the
461 time should be multiplied by the number of screen lines affected by the
462 command.
463
464      :al=1.3*\E[L:
465
466 is used to describe the "insert line" command for a certain terminal.
467 The padding required is 1.3 msec per line affected.  The command itself
468 is `<ESC> [ L'.
469
470    The padding time specified in this way tells `tputs' how many pad
471 characters to output.  *Note Output Padding::.
472
473    Two special capability values affect padding for all commands.
474 These are the `pc' and `pb'.  The variable `pc' specifies the character
475 to pad with, and `pb' the speed below which no padding is needed.  The
476 defaults for these variables, a null character and 0, are correct for
477 most terminals.  *Note Pad Specs::.
478
479 \1f
480 File: termcap.info,  Node: Output Padding,  Prev: Describe Padding,  Up: Padding
481
482 1.5.3 Performing Padding with `tputs'
483 -------------------------------------
484
485 Use the termcap function `tputs' to output a string containing an
486 optional padding spec of the form described above (*note Describe
487 Padding::).  The function `tputs' strips off and decodes the padding
488 spec, outputs the rest of the string, and then outputs the appropriate
489 padding.  Here is its declaration in ANSI C:
490
491      char PC;
492      short ospeed;
493
494      int tputs (char *STRING, int NLINES, int (*OUTFUN) ());
495
496    Here STRING is the string (including padding spec) to be output;
497 NLINES is the number of lines affected by the operation, which is used
498 to multiply the amount of padding if the padding spec ends with a `*'.
499 Finally, OUTFUN is a function (such as `fputchar') that is called to
500 output each character.  When actually called, OUTFUN should expect one
501 argument, a character.
502
503    The operation of `tputs' is controlled by two global variables,
504 `ospeed' and `PC'.  The value of `ospeed' is supposed to be the
505 terminal output speed, encoded as in the `ioctl' system call which gets
506 the speed information.  This is needed to compute the number of padding
507 characters.  The value of `PC' is the character used for padding.
508
509    You are responsible for storing suitable values into these variables
510 before using `tputs'.  The value stored into the `PC' variable should be
511 taken from the `pc' capability in the terminal description (*note Pad
512 Specs::).  Store zero in `PC' if there is no `pc' capability.
513
514    The argument NLINES requires some thought.  Normally, it should be
515 the number of lines whose contents will be cleared or moved by the
516 command.  For cursor motion commands, or commands that do editing
517 within one line, use the value 1.  For most commands that affect
518 multiple lines, such as `al' (insert a line) and `cd' (clear from the
519 cursor to the end of the screen), NLINES should be the screen height
520 minus the current vertical position (origin 0).  For multiple insert
521 and scroll commands such as `AL' (insert multiple lines), that same
522 value for NLINES is correct; the number of lines being inserted is not
523 correct.
524
525    If a "scroll window" feature is used to reduce the number of lines
526 affected by a command, the value of NLINES should take this into
527 account.  This is because the delay time required depends on how much
528 work the terminal has to do, and the scroll window feature reduces the
529 work.  *Note Scrolling::.
530
531    Commands such as `ic' and `dc' (insert or delete characters) are
532 problematical because the padding needed by these commands is
533 proportional to the number of characters affected, which is the number
534 of columns from the cursor to the end of the line.  It would be nice to
535 have a way to specify such a dependence, and there is no need for
536 dependence on vertical position in these commands, so it is an obvious
537 idea to say that for these commands NLINES should really be the number
538 of columns affected.  However, the definition of termcap clearly says
539 that NLINES is always the number of lines affected, even in this case,
540 where it is always 1.  It is not easy to change this rule now, because
541 too many programs and terminal descriptions have been written to follow
542 it.
543
544    Because NLINES is always 1 for the `ic' and `dc' strings, there is
545 no reason for them to use `*', but some of them do.  These should be
546 corrected by deleting the `*'.  If, some day, such entries have
547 disappeared, it may be possible to change to a more useful convention
548 for the NLINES argument for these operations without breaking any
549 programs.
550
551 \1f
552 File: termcap.info,  Node: Parameters,  Prev: Padding,  Up: Library
553
554 1.6 Filling In Parameters
555 =========================
556
557 Some terminal control strings require numeric "parameters".  For
558 example, when you move the cursor, you need to say what horizontal and
559 vertical positions to move it to.  The value of the terminal's `cm'
560 capability, which says how to move the cursor, cannot simply be a
561 string of characters; it must say how to express the cursor position
562 numbers and where to put them within the command.
563
564    The specifications of termcap include conventions as to which
565 string-valued capabilities require parameters, how many parameters, and
566 what the parameters mean; for example, it defines the `cm' string to
567 take two parameters, the vertical and horizontal positions, with 0,0
568 being the upper left corner.  These conventions are described where the
569 individual commands are documented.
570
571    Termcap also defines a language used within the capability
572 definition for specifying how and where to encode the parameters for
573 output.  This language uses character sequences starting with `%'.
574 (This is the same idea as `printf', but the details are different.)
575 The language for parameter encoding is described in this section.
576
577    A program that is doing display output calls the functions `tparam'
578 or `tgoto' to encode parameters according to the specifications.  These
579 functions produce a string containing the actual commands to be output
580 (as well a padding spec which must be processed with `tputs'; *note
581 Padding::).
582
583 * Menu:
584
585 * Encode Parameters:: The language for encoding parameters.
586 * Using Parameters::  Outputting a string command with parameters.
587
588 \1f
589 File: termcap.info,  Node: Encode Parameters,  Next: Using Parameters,  Prev: Parameters,  Up: Parameters
590
591 1.6.1 Describing the Encoding
592 -----------------------------
593
594 A terminal command string that requires parameters contains special
595 character sequences starting with `%' to say how to encode the
596 parameters.  These sequences control the actions of `tparam' and
597 `tgoto'.
598
599    The parameters values passed to `tparam' or `tgoto' are considered
600 to form a vector.  A pointer into this vector determines the next
601 parameter to be processed.  Some of the `%'-sequences encode one
602 parameter and advance the pointer to the next parameter.  Other
603 `%'-sequences alter the pointer or alter the parameter values without
604 generating output.
605
606    For example, the `cm' string for a standard ANSI terminal is written
607 as `\E[%i%d;%dH'.  (`\E' stands for <ESC>.)  `cm' by convention always
608 requires two parameters, the vertical and horizontal goal positions, so
609 this string specifies the encoding of two parameters.  Here `%i'
610 increments the two values supplied, and each `%d' encodes one of the
611 values in decimal.  If the cursor position values 20,58 are encoded
612 with this string, the result is `\E[21;59H'.
613
614    First, here are the `%'-sequences that generate output.  Except for
615 `%%', each of them encodes one parameter and advances the pointer to
616 the following parameter.
617
618 `%%'
619      Output a single `%'.  This is the only way to represent a literal
620      `%' in a terminal command with parameters.  `%%' does not use up a
621      parameter.
622
623 `%d'
624      As in `printf', output the next parameter in decimal.
625
626 `%2'
627      Like `%02d' in `printf': output the next parameter in decimal, and
628      always use at least two digits.
629
630 `%3'
631      Like `%03d' in `printf': output the next parameter in decimal, and
632      always use at least three digits.  Note that `%4' and so on are
633      _not_ defined.
634
635 `%.'
636      Output the next parameter as a single character whose ASCII code is
637      the parameter value.  Like `%c' in `printf'.
638
639 `%+CHAR'
640      Add the next parameter to the character CHAR, and output the
641      resulting character.  For example, `%+ ' represents 0 as a space,
642      1 as `!', etc.
643
644    The following `%'-sequences specify alteration of the parameters
645 (their values, or their order) rather than encoding a parameter for
646 output.  They generate no output; they are used only for their side
647 effects on the parameters.  Also, they do not advance the "next
648 parameter" pointer except as explicitly stated.  Only `%i', `%r' and
649 `%>' are defined in standard Unix termcap.  The others are GNU
650 extensions.
651
652 `%i'
653      Increment the next two parameters.  This is used for terminals that
654      expect cursor positions in origin 1.  For example, `%i%d,%d' would
655      output two parameters with `1' for 0, `2' for 1, etc.
656
657 `%r'
658      Interchange the next two parameters.  This is used for terminals
659      whose cursor positioning command expects the horizontal position
660      first.
661
662 `%s'
663      Skip the next parameter.  Do not output anything.
664
665 `%b'
666      Back up one parameter.  The last parameter used will become once
667      again the next parameter to be output, and the next output command
668      will use it.  Using `%b' more than once, you can back up any
669      number of parameters, and you can refer to each parameter any
670      number of times.
671
672 `%>C1C2'
673      Conditionally increment the next parameter.  Here C1 and C2 are
674      characters which stand for their ASCII codes as numbers.  If the
675      next parameter is greater than the ASCII code of C1, the ASCII
676      code of C2 is added to it.
677
678 `%a OP TYPE POS'
679      Perform arithmetic on the next parameter, do not use it up, and do
680      not output anything.  Here OP specifies the arithmetic operation,
681      while TYPE and POS together specify the other operand.
682
683      Spaces are used above to separate the operands for clarity; the
684      spaces don't appear in the data base, where this sequence is
685      exactly five characters long.
686
687      The character OP says what kind of arithmetic operation to
688      perform.  It can be any of these characters:
689
690     `='
691           assign a value to the next parameter, ignoring its old value.
692           The new value comes from the other operand.
693
694     `+'
695           add the other operand to the next parameter.
696
697     `-'
698           subtract the other operand from the next parameter.
699
700     `*'
701           multiply the next parameter by the other operand.
702
703     `/'
704           divide the next parameter by the other operand.
705
706      The "other operand" may be another parameter's value or a constant;
707      the character TYPE says which.  It can be:
708
709     `p'
710           Use another parameter.  The character POS says which
711           parameter to use.  Subtract 64 from its ASCII code to get the
712           position of the desired parameter relative to this one.  Thus,
713           the character `A' as POS means the parameter after the next
714           one; the character `?' means the parameter before the next
715           one.
716
717     `c'
718           Use a constant value.  The character POS specifies the value
719           of the constant.  The 0200 bit is cleared out, so that 0200
720           can be used to represent zero.
721
722    The following `%'-sequences are special purpose hacks to compensate
723 for the weird designs of obscure terminals.  They modify the next
724 parameter or the next two parameters but do not generate output and do
725 not use up any parameters.  `%m' is a GNU extension; the others are
726 defined in standard Unix termcap.
727
728 `%n'
729      Exclusive-or the next parameter with 0140, and likewise the
730      parameter after next.
731
732 `%m'
733      Complement all the bits of the next parameter and the parameter
734      after next.
735
736 `%B'
737      Encode the next parameter in BCD.  It alters the value of the
738      parameter by adding six times the quotient of the parameter by ten.
739      Here is a C statement that shows how the new value is computed:
740
741           PARM = (PARM / 10) * 16 + PARM % 10;
742
743 `%D'
744      Transform the next parameter as needed by Delta Data terminals.
745      This involves subtracting twice the remainder of the parameter by
746      16.
747
748           PARM -= 2 * (PARM % 16);
749
750 \1f
751 File: termcap.info,  Node: Using Parameters,  Prev: Encode Parameters,  Up: Parameters
752
753 1.6.2 Sending Display Commands with Parameters
754 ----------------------------------------------
755
756 The termcap library functions `tparam' and `tgoto' serve as the analog
757 of `printf' for terminal string parameters.  The newer function
758 `tparam' is a GNU extension, more general but missing from Unix
759 termcap.  The original parameter-encoding function is `tgoto', which is
760 preferable for cursor motion.
761
762 * Menu:
763
764 * tparam::   The general case, for GNU termcap only.
765 * tgoto::    The special case of cursor motion.
766
767 \1f
768 File: termcap.info,  Node: tparam,  Next: tgoto,  Prev: Using Parameters,  Up: Using Parameters
769
770 1.6.2.1 `tparam'
771 ................
772
773 The function `tparam' can encode display commands with any number of
774 parameters and allows you to specify the buffer space.  It is the
775 preferred function for encoding parameters for all but the `cm'
776 capability.  Its ANSI C declaration is as follows:
777
778      char *tparam (char *CTLSTRING, char *BUFFER, int SIZE, int PARM1,...)
779
780    The arguments are a control string CTLSTRING (the value of a terminal
781 capability, presumably), an output buffer BUFFER and SIZE, and any
782 number of integer parameters to be encoded.  The effect of `tparam' is
783 to copy the control string into the buffer, encoding parameters
784 according to the `%' sequences in the control string.
785
786    You describe the output buffer by its address, BUFFER, and its size
787 in bytes, SIZE.  If the buffer is not big enough for the data to be
788 stored in it, `tparam' calls `malloc' to get a larger buffer.  In
789 either case, `tparam' returns the address of the buffer it ultimately
790 uses.  If the value equals BUFFER, your original buffer was used.
791 Otherwise, a new buffer was allocated, and you must free it after you
792 are done with printing the results.  If you pass zero for SIZE and
793 BUFFER, `tparam' always allocates the space with `malloc'.
794
795    All capabilities that require parameters also have the ability to
796 specify padding, so you should use `tputs' to output the string
797 produced by `tparam'.  *Note Padding::.  Here is an example.
798
799      {
800        char *buf;
801        char buffer[40];
802
803        buf = tparam (command, buffer, 40, parm);
804        tputs (buf, 1, fputchar);
805        if (buf != buffer)
806          free (buf);
807      }
808
809    If a parameter whose value is zero is encoded with `%.'-style
810 encoding, the result is a null character, which will confuse `tputs'.
811 This would be a serious problem, but luckily `%.' encoding is used only
812 by a few old models of terminal, and only for the `cm' capability.  To
813 solve the problem, use `tgoto' rather than `tparam' to encode the `cm'
814 capability.
815
816 \1f
817 File: termcap.info,  Node: tgoto,  Prev: tparam,  Up: Using Parameters
818
819 1.6.2.2 `tgoto'
820 ...............
821
822 The special case of cursor motion is handled by `tgoto'.  There are two
823 reasons why you might choose to use `tgoto':
824
825    * For Unix compatibility, because Unix termcap does not have
826      `tparam'.
827
828    * For the `cm' capability, since `tgoto' has a special feature to
829      avoid problems with null characters, tabs and newlines on certain
830      old terminal types that use `%.' encoding for that capability.
831
832    Here is how `tgoto' might be declared in ANSI C:
833
834      char *tgoto (char *CSTRING, int HPOS, int VPOS)
835
836    There are three arguments, the terminal description's `cm' string and
837 the two cursor position numbers; `tgoto' computes the parametrized
838 string in an internal static buffer and returns the address of that
839 buffer.  The next time you use `tgoto' the same buffer will be reused.
840
841    Parameters encoded with `%.' encoding can generate null characters,
842 tabs or newlines.  These might cause trouble: the null character because
843 `tputs' would think that was the end of the string, the tab because the
844 kernel or other software might expand it into spaces, and the newline
845 becaue the kernel might add a carriage-return, or padding characters
846 normally used for a newline.  To prevent such problems, `tgoto' is
847 careful to avoid these characters.  Here is how this works: if the
848 target cursor position value is such as to cause a problem (that is to
849 say, zero, nine or ten), `tgoto' increments it by one, then compensates
850 by appending a string to move the cursor back or up one position.
851
852    The compensation strings to use for moving back or up are found in
853 global variables named `BC' and `UP'.  These are actual external C
854 variables with upper case names; they are declared `char *'.  It is up
855 to you to store suitable values in them, normally obtained from the
856 `le' and `up' terminal capabilities in the terminal description with
857 `tgetstr'.  Alternatively, if these two variables are both zero, the
858 feature of avoiding nulls, tabs and newlines is turned off.
859
860    It is safe to use `tgoto' for commands other than `cm' only if you
861 have stored zero in `BC' and `UP'.
862
863    Note that `tgoto' reverses the order of its operands: the horizontal
864 position comes before the vertical position in the arguments to
865 `tgoto', even though the vertical position comes before the horizontal
866 in the parameters of the `cm' string.  If you use `tgoto' with a
867 command such as `AL' that takes one parameter, you must pass the
868 parameter to `tgoto' as the "vertical position".
869
870 \1f
871 File: termcap.info,  Node: Data Base,  Next: Capabilities,  Prev: Library,  Up: Top
872
873 2 The Format of the Data Base
874 *****************************
875
876 The termcap data base of terminal descriptions is stored in the file
877 `/etc/termcap'.  It contains terminal descriptions, blank lines, and
878 comments.
879
880    A terminal description starts with one or more names for the
881 terminal type.  The information in the description is a series of
882 "capability names" and values.  The capability names have standard
883 meanings (*note Capabilities::) and their values describe the terminal.
884
885 * Menu:
886
887 * Format::            Overall format of a terminal description.
888 * Capability Format:: Format of capabilities within a description.
889 * Naming::            Naming conventions for terminal types.
890 * Inheriting::        Inheriting part of a description from
891                         a related terminal type.
892
893 \1f
894 File: termcap.info,  Node: Format,  Next: Capability Format,  Prev: Data Base,  Up: Data Base
895
896 2.1 Terminal Description Format
897 ===============================
898
899 Aside from comments (lines starting with `#', which are ignored), each
900 nonblank line in the termcap data base is a terminal description.  A
901 terminal description is nominally a single line, but it can be split
902 into multiple lines by inserting the two characters `\ newline'.  This
903 sequence is ignored wherever it appears in a description.
904
905    The preferred way to split the description is between capabilities:
906 insert the four characters `: \ newline tab' immediately before any
907 colon.  This allows each sub-line to start with some indentation.  This
908 works because, after the `\ newline' are ignored, the result is `: tab
909 :'; the first colon ends the preceding capability and the second colon
910 starts the next capability.  If you split with `\ newline' alone, you
911 may not add any indentation after them.
912
913    Here is a real example of a terminal description:
914
915      dw|vt52|DEC vt52:\
916              :cr=^M:do=^J:nl=^J:bl=^G:\
917              :le=^H:bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:\
918              :nd=\EC:ta=^I:pt:sr=\EI:up=\EA:\
919              :ku=\EA:kd=\EB:kr=\EC:kl=\ED:kb=^H:
920
921    Each terminal description begins with several names for the terminal
922 type.  The names are separated by `|' characters, and a colon ends the
923 last name.  The first name should be two characters long; it exists
924 only for the sake of very old Unix systems and is never used in modern
925 systems.  The last name should be a fully verbose name such as "DEC
926 vt52" or "Ann Arbor Ambassador with 48 lines".  The other names should
927 include whatever the user ought to be able to specify to get this
928 terminal type, such as `vt52' or `aaa-48'.  *Note Naming::, for
929 information on how to choose terminal type names.
930
931    After the terminal type names come the terminal capabilities,
932 separated by colons and with a colon after the last one.  Each
933 capability has a two-letter name, such as `cm' for "cursor motion
934 string" or `li' for "number of display lines".
935
936 \1f
937 File: termcap.info,  Node: Capability Format,  Next: Naming,  Prev: Format,  Up: Data Base
938
939 2.2 Writing the Capabilities
940 ============================
941
942 There are three kinds of capabilities: flags, numbers, and strings.
943 Each kind has its own way of being written in the description.  Each
944 defined capability has by convention a particular kind of value; for
945 example, `li' always has a numeric value and `cm' always a string value.
946
947    A flag capability is thought of as having a boolean value: the value
948 is true if the capability is present, false if not.  When the
949 capability is present, just write its name between two colons.
950
951    A numeric capability has a value which is a nonnegative number.
952 Write the capability name, a `#', and the number, between two colons.
953 For example, `...:li#48:...' is how you specify the `li' capability for
954 48 lines.
955
956    A string-valued capability has a value which is a sequence of
957 characters.  Usually these are the characters used to perform some
958 display operation.  Write the capability name, a `=', and the
959 characters of the value, between two colons.  For example,
960 `...:cm=\E[%i%d;%dH:...' is how the cursor motion command for a
961 standard ANSI terminal would be specified.
962
963    Special characters in the string value can be expressed using
964 `\'-escape sequences as in C; in addition, `\E' stands for <ESC>.  `^'
965 is also a kind of escape character; `^' followed by CHAR stands for the
966 control-equivalent of CHAR.  Thus, `^a' stands for the character
967 control-a, just like `\001'.  `\' and `^' themselves can be represented
968 as `\\' and `\^'.
969
970    To include a colon in the string, you must write `\072'.  You might
971 ask, "Why can't `\:' be used to represent a colon?"  The reason is that
972 the interrogation functions do not count slashes while looking for a
973 capability.  Even if `:ce=ab\:cd:' were interpreted as giving the `ce'
974 capability the value `ab:cd', it would also appear to define `cd' as a
975 flag.
976
977    The string value will often contain digits at the front to specify
978 padding (*note Padding::) and/or `%'-sequences within to specify how to
979 encode parameters (*note Parameters::).  Although these things are not
980 to be output literally to the terminal, they are considered part of the
981 value of the capability.  They are special only when the string value
982 is processed by `tputs', `tparam' or `tgoto'.  By contrast, `\' and `^'
983 are considered part of the syntax for specifying the characters in the
984 string.
985
986    Let's look at the VT52 example again:
987
988      dw|vt52|DEC vt52:\
989              :cr=^M:do=^J:nl=^J:bl=^G:\
990              :le=^H:bs:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :co#80:li#24:\
991              :nd=\EC:ta=^I:pt:sr=\EI:up=\EA:\
992              :ku=\EA:kd=\EB:kr=\EC:kl=\ED:kb=^H:
993
994    Here we see the numeric-valued capabilities `co' and `li', the flags
995 `bs' and `pt', and many string-valued capabilities.  Most of the
996 strings start with <ESC> represented as `\E'.  The rest contain control
997 characters represented using `^'.  The meanings of the individual
998 capabilities are defined elsewhere (*note Capabilities::).
999
1000 \1f
1001 File: termcap.info,  Node: Naming,  Next: Inheriting,  Prev: Capability Format,  Up: Data Base
1002
1003 2.3 Terminal Type Name Conventions
1004 ==================================
1005
1006 There are conventions for choosing names of terminal types.  For one
1007 thing, all letters should be in lower case.  The terminal type for a
1008 terminal in its most usual or most fundamental mode of operation should
1009 not have a hyphen in it.
1010
1011    If the same terminal has other modes of operation which require
1012 different terminal descriptions, these variant descriptions are given
1013 names made by adding suffixes with hyphens.  Such alternate descriptions
1014 are used for two reasons:
1015
1016    * When the terminal has a switch that changes its behavior.  Since
1017      the computer cannot tell how the switch is set, the user must tell
1018      the computer by choosing the appropriate terminal type name.
1019
1020      For example, the VT-100 has a setup flag that controls whether the
1021      cursor wraps at the right margin.  If this flag is set to "wrap",
1022      you must use the terminal type `vt100-am'.  Otherwise you must use
1023      `vt100-nam'.  Plain `vt100' is defined as a synonym for either
1024      `vt100-am' or `vt100-nam' depending on the preferences of the
1025      local site.
1026
1027      The standard suffix `-am' stands for "automatic margins".
1028
1029    * To give the user a choice in how to use the terminal.  This is done
1030      when the terminal has a switch that the computer normally controls.
1031
1032      For example, the Ann Arbor Ambassador can be configured with many
1033      screen sizes ranging from 20 to 60 lines.  Fewer lines make bigger
1034      characters but more lines let you see more of what you are editing.
1035      As a result, users have different preferences.  Therefore, termcap
1036      provides terminal types for many screen sizes.  If you choose type
1037      `aaa-30', the terminal will be configured to use 30 lines; if you
1038      choose `aaa-48', 48 lines will be used, and so on.
1039
1040    Here is a list of standard suffixes and their conventional meanings:
1041
1042 `-w'
1043      Short for "wide".  This is a mode that gives the terminal more
1044      columns than usual.  This is normally a user option.
1045
1046 `-am'
1047      "Automatic margins".  This is an alternate description for use when
1048      the terminal's margin-wrap switch is on; it contains the `am'
1049      flag.  The implication is that normally the switch is off and the
1050      usual description for the terminal says that the switch is off.
1051
1052 `-nam'
1053      "No automatic margins".  The opposite of `-am', this names an
1054      alternative description which lacks the `am' flag.  This implies
1055      that the terminal is normally operated with the margin-wrap switch
1056      turned on, and the normal description of the terminal says so.
1057
1058 `-na'
1059      "No arrows".  This terminal description initializes the terminal to
1060      keep its arrow keys in local mode.  This is a user option.
1061
1062 `-rv'
1063      "Reverse video".  This terminal description causes text output for
1064      normal video to appear as reverse, and text output for reverse
1065      video to come out as normal.  Often this description differs from
1066      the usual one by interchanging the two strings which turn reverse
1067      video on and off.
1068
1069      This is a user option; you can choose either the "reverse video"
1070      variant terminal type or the normal terminal type, and termcap will
1071      obey.
1072
1073 `-s'
1074      "Status".  Says to enable use of a status line which ordinary
1075      output does not touch (*note Status Line::).
1076
1077      Some terminals have a special line that is used only as a status
1078      line.  For these terminals, there is no need for a `-s' variant;
1079      the status line commands should be defined by default.  On other
1080      terminals, enabling a status line means removing one screen line
1081      from ordinary use and reducing the effective screen height.  For
1082      these terminals, the user can choose the `-s' variant type to
1083      request use of a status line.
1084
1085 `-NLINES'
1086      Says to operate with NLINES lines on the screen, for terminals
1087      such as the Ambassador which provide this as an option.  Normally
1088      this is a user option; by choosing the terminal type, you control
1089      how many lines termcap will use.
1090
1091 `-NPAGESp'
1092      Says that the terminal has NPAGES pages worth of screen memory,
1093      for terminals where this is a hardware option.
1094
1095 `-unk'
1096      Says that description is not for direct use, but only for
1097      reference in `tc' capabilities.  Such a description is a kind of
1098      subroutine, because it describes the common characteristics of
1099      several variant descriptions that would use other suffixes in
1100      place of `-unk'.
1101
1102 \1f
1103 File: termcap.info,  Node: Inheriting,  Prev: Naming,  Up: Data Base
1104
1105 2.4 Inheriting from Related Descriptions
1106 ========================================
1107
1108 When two terminal descriptions are similar, their identical parts do not
1109 need to be given twice.  Instead, one of the two can be defined in
1110 terms of the other, using the `tc' capability.  We say that one
1111 description "refers to" the other, or "inherits from" the other.
1112
1113    The `tc' capability must be the last one in the terminal description,
1114 and its value is a string which is the name of another terminal type
1115 which is referred to.  For example,
1116
1117      N9|aaa|ambassador|aaa-30|ann arbor ambassador/30 lines:\
1118              :ti=\E[2J\E[30;0;0;30p:\
1119              :te=\E[60;0;0;30p\E[30;1H\E[J:\
1120              :li#30:tc=aaa-unk:
1121
1122 defines the terminal type `aaa-30' (also known as plain `aaa') in terms
1123 of `aaa-unk', which defines everything about the Ambassador that is
1124 independent of screen height.  The types `aaa-36', `aaa-48' and so on
1125 for other screen heights are likewise defined to inherit from `aaa-unk'.
1126
1127    The capabilities overridden by `aaa-30' include `li', which says how
1128 many lines there are, and `ti' and `te', which configure the terminal
1129 to use that many lines.
1130
1131    The effective terminal description for type `aaa' consists of the
1132 text shown above followed by the text of the description of `aaa-unk'.
1133 The `tc' capability is handled automatically by `tgetent', which finds
1134 the description thus referenced and combines the two descriptions
1135 (*note Find::).  Therefore, only the implementor of the terminal
1136 descriptions needs to think about using `tc'.  Users and application
1137 programmers do not need to be concerned with it.
1138
1139    Since the reference terminal description is used last, capabilities
1140 specified in the referring description override any specifications of
1141 the same capabilities in the reference description.
1142
1143    The referring description can cancel out a capability without
1144 specifying any new value for it by means of a special trick.  Write the
1145 capability in the referring description, with the character `@' after
1146 the capability name, as follows:
1147
1148      NZ|aaa-30-nam|ann arbor ambassador/30 lines/no automatic-margins:\
1149              :am@:tc=aaa-30:
1150
1151 \1f
1152 File: termcap.info,  Node: Capabilities,  Next: Summary,  Prev: Data Base,  Up: Top
1153
1154 3 Definitions of the Terminal Capabilities
1155 ******************************************
1156
1157 This section is divided into many subsections, each for one aspect of
1158 use of display terminals.  For writing a display program, you usually
1159 need only check the subsections for the operations you want to use.
1160 For writing a terminal description, you must read each subsection and
1161 fill in the capabilities described there.
1162
1163    String capabilities that are display commands may require numeric
1164 parameters (*note Parameters::).  Most such capabilities do not use
1165 parameters.  When a capability requires parameters, this is explicitly
1166 stated at the beginning of its definition.  In simple cases, the first
1167 or second sentence of the definition mentions all the parameters, in
1168 the order they should be given, using a name in upper case for each
1169 one.  For example, the `rp' capability is a command that requires two
1170 parameters; its definition begins as follows:
1171
1172      String of commands to output a graphic character C, repeated N
1173      times.
1174
1175    In complex cases or when there are many parameters, they are
1176 described explicitly.
1177
1178    When a capability is described as obsolete, this means that programs
1179 should not be written to look for it, but terminal descriptions should
1180 still be written to provide it.
1181
1182    When a capability is described as very obsolete, this means that it
1183 should be omitted from terminal descriptions as well.
1184
1185 * Menu:
1186
1187 * Basic::             Basic characteristics.
1188 * Screen Size::       Screen size, and what happens when it changes.
1189 * Cursor Motion::     Various ways to move the cursor.
1190 * Scrolling::         Pushing text up and down on the screen.
1191 * Wrapping::          What happens if you write a character in the last column.
1192 * Windows::           Limiting the part of the window that output affects.
1193 * Clearing::          Erasing one or many lines.
1194 * Insdel Line::       Making new blank lines in mid-screen; deleting lines.
1195 * Insdel Char::       Inserting and deleting characters within a line.
1196 * Standout::          Highlighting some of the text.
1197 * Underlining::       Underlining some of the text.
1198 * Cursor Visibility:: Making the cursor more or less easy to spot.
1199 * Bell::              Attracts user's attention; not localized on the screen.
1200 * Keypad::            Recognizing when function keys or arrows are typed.
1201 * Meta Key::          <META> acts like an extra shift key.
1202 * Initialization::    Commands used to initialize or reset the terminal.
1203 * Pad Specs::         Info for the kernel on how much padding is needed.
1204 * Status Line::       A status line displays ``background'' information.
1205 * Half-Line::         Moving by half-lines, for superscripts and subscripts.
1206 * Printer::           Controlling auxiliary printers of display terminals.
1207
1208 \1f
1209 File: termcap.info,  Node: Basic,  Next: Screen Size,  Prev: Capabilities,  Up: Capabilities
1210
1211 3.1 Basic Characteristics
1212 =========================
1213
1214 This section documents the capabilities that describe the basic and
1215 nature of the terminal, and also those that are relevant to the output
1216 of graphic characters.
1217
1218 `os'
1219      Flag whose presence means that the terminal can overstrike.  This
1220      means that outputting a graphic character does not erase whatever
1221      was present in the same character position before.  The terminals
1222      that can overstrike include printing terminals, storage tubes (all
1223      obsolete nowadays), and many bit-map displays.
1224
1225 `eo'
1226      Flag whose presence means that outputting a space can erase an
1227      overstrike.  If this is not present and overstriking is supported,
1228      output of a space has no effect except to move the cursor.
1229
1230 `gn'
1231      Flag whose presence means that this terminal type is a generic type
1232      which does not really describe any particular terminal.  Generic
1233      types are intended for use as the default type assigned when the
1234      user connects to the system, with the intention that the user
1235      should specify what type he really has.  One example of a generic
1236      type is the type `network'.
1237
1238      Since the generic type cannot say how to do anything interesting
1239      with the terminal, termcap-using programs will always find that the
1240      terminal is too weak to be supported if the user has failed to
1241      specify a real terminal type in place of the generic one.  The
1242      `gn' flag directs these programs to use a different error message:
1243      "You have not specified your real terminal type", rather than
1244      "Your terminal is not powerful enough to be used".
1245
1246 `hc'
1247      Flag whose presence means this is a hardcopy terminal.
1248
1249 `rp'
1250      String of commands to output a graphic character C, repeated N
1251      times.  The first parameter value is the ASCII code for the desired
1252      character, and the second parameter is the number of times to
1253      repeat the character.  Often this command requires padding
1254      proportional to the number of times the character is repeated.
1255      This effect can be had by using parameter arithmetic with
1256      `%'-sequences to compute the amount of padding, then generating
1257      the result as a number at the front of the string so that `tputs'
1258      will treat it as padding.
1259
1260 `hz'
1261      Flag whose presence means that the ASCII character `~' cannot be
1262      output on this terminal because it is used for display commands.
1263
1264      Programs handle this flag by checking all text to be output and
1265      replacing each `~' with some other character(s).  If this is not
1266      done, the screen will be thoroughly garbled.
1267
1268      The old Hazeltine terminals that required such treatment are
1269      probably very rare today, so you might as well not bother to
1270      support this flag.
1271
1272 `CC'
1273      String whose presence means the terminal has a settable command
1274      character.  The value of the string is the default command
1275      character (which is usually <ESC>).
1276
1277      All the strings of commands in the terminal description should be
1278      written to use the default command character.  If you are writing
1279      an application program that changes the command character, use the
1280      `CC' capability to figure out how to translate all the display
1281      commands to work with the new command character.
1282
1283      Most programs have no reason to look at the `CC' capability.
1284
1285 `xb'
1286      Flag whose presence identifies Superbee terminals which are unable
1287      to transmit the characters <ESC> and `Control-C'.  Programs which
1288      support this flag are supposed to check the input for the code
1289      sequences sent by the <F1> and <F2> keys, and pretend that <ESC>
1290      or `Control-C' (respectively) had been read.  But this flag is
1291      obsolete, and not worth supporting.
1292
1293 \1f
1294 File: termcap.info,  Node: Screen Size,  Next: Cursor Motion,  Prev: Basic,  Up: Capabilities
1295
1296 3.2 Screen Size
1297 ===============
1298
1299 A terminal description has two capabilities, `co' and `li', that
1300 describe the screen size in columns and lines.  But there is more to
1301 the question of screen size than this.
1302
1303    On some operating systems the "screen" is really a window and the
1304 effective width can vary.  On some of these systems, `tgetnum' uses the
1305 actual width of the window to decide what value to return for the `co'
1306 capability, overriding what is actually written in the terminal
1307 description.  On other systems, it is up to the application program to
1308 check the actual window width using a system call.  For example, on BSD
1309 4.3 systems, the system call `ioctl' with code `TIOCGWINSZ' will tell
1310 you the current screen size.
1311
1312    On all window systems, termcap is powerless to advise the application
1313 program if the user resizes the window.  Application programs must deal
1314 with this possibility in a system-dependent fashion.  On some systems
1315 the C shell handles part of the problem by detecting changes in window
1316 size and setting the `TERMCAP' environment variable appropriately.
1317 This takes care of application programs that are started subsequently.
1318 It does not help application programs already running.
1319
1320    On some systems, including BSD 4.3, all programs using a terminal get
1321 a signal named `SIGWINCH' whenever the screen size changes.  Programs
1322 that use termcap should handle this signal by using `ioctl TIOCGWINSZ'
1323 to learn the new screen size.
1324
1325 `co'
1326      Numeric value, the width of the screen in character positions.
1327      Even hardcopy terminals normally have a `co' capability.
1328
1329 `li'
1330      Numeric value, the height of the screen in lines.
1331
1332 \1f
1333 File: termcap.info,  Node: Cursor Motion,  Next: Wrapping,  Prev: Screen Size,  Up: Capabilities
1334
1335 3.3 Cursor Motion
1336 =================
1337
1338 Termcap assumes that the terminal has a "cursor", a spot on the screen
1339 where a visible mark is displayed, and that most display commands take
1340 effect at the position of the cursor.  It follows that moving the cursor
1341 to a specified location is very important.
1342
1343    There are many terminal capabilities for different cursor motion
1344 operations.  A terminal description should define as many as possible,
1345 but most programs do not need to use most of them.  One capability,
1346 `cm', moves the cursor to an arbitrary place on the screen; this by
1347 itself is sufficient for any application as long as there is no need to
1348 support hardcopy terminals or certain old, weak displays that have only
1349 relative motion commands.  Use of other cursor motion capabilities is an
1350 optimization, enabling the program to output fewer characters in some
1351 common cases.
1352
1353    If you plan to use the relative cursor motion commands in an
1354 application program, you must know what the starting cursor position
1355 is.  To do this, you must keep track of the cursor position and update
1356 the records each time anything is output to the terminal, including
1357 graphic characters.  In addition, it is necessary to know whether the
1358 terminal wraps after writing in the rightmost column.  *Note Wrapping::.
1359
1360    One other motion capability needs special mention: `nw' moves the
1361 cursor to the beginning of the following line, perhaps clearing all the
1362 starting line after the cursor, or perhaps not clearing at all.  This
1363 capability is a least common denominator that is probably supported
1364 even by terminals that cannot do most other things such as `cm' or `do'.
1365 Even hardcopy terminals can support `nw'.
1366
1367 `cm'
1368      String of commands to position the cursor at line L, column C.
1369      Both parameters are origin-zero, and are defined relative to the
1370      screen, not relative to display memory.
1371
1372      All display terminals except a few very obsolete ones support `cm',
1373      so it is acceptable for an application program to refuse to
1374      operate on terminals lacking `cm'.
1375
1376 `ho'
1377      String of commands to move the cursor to the upper left corner of
1378      the screen (this position is called the "home position").  In
1379      terminals where the upper left corner of the screen is not the
1380      same as the beginning of display memory, this command must go to
1381      the upper left corner of the screen, not the beginning of display
1382      memory.
1383
1384      Every display terminal supports this capability, and many
1385      application programs refuse to operate if the `ho' capability is
1386      missing.
1387
1388 `ll'
1389      String of commands to move the cursor to the lower left corner of
1390      the screen.  On some terminals, moving up from home position does
1391      this, but programs should never assume that will work.  Just
1392      output the `ll' string (if it is provided); if moving to home
1393      position and then moving up is the best way to get there, the `ll'
1394      command will do that.
1395
1396 `cr'
1397      String of commands to move the cursor to the beginning of the line
1398      it is on.  If this capability is not specified, many programs
1399      assume they can use the ASCII carriage return character for this.
1400
1401 `le'
1402      String of commands to move the cursor left one column.  Unless the
1403      `bw' flag capability is specified, the effect is undefined if the
1404      cursor is at the left margin; do not use this command there.  If
1405      `bw' is present, this command may be used at the left margin, and
1406      it wraps the cursor to the last column of the preceding line.
1407
1408 `nd'
1409      String of commands to move the cursor right one column.  The
1410      effect is undefined if the cursor is at the right margin; do not
1411      use this command there, not even if `am' is present.
1412
1413 `up'
1414      String of commands to move the cursor vertically up one line.  The
1415      effect of sending this string when on the top line is undefined;
1416      programs should never use it that way.
1417
1418 `do'
1419      String of commands to move the cursor vertically down one line.
1420      The effect of sending this string when on the bottom line is
1421      undefined; programs should never use it that way.
1422
1423      The original idea was that this string would not contain a newline
1424      character and therefore could be used without disabling the
1425      kernel's usual habit of converting of newline into a
1426      carriage-return newline sequence.  But many terminal descriptions
1427      do use newline in the `do' string, so this is not possible; a
1428      program which sends the `do' string must disable output conversion
1429      in the kernel (*note Initialize::).
1430
1431 `bw'
1432      Flag whose presence says that `le' may be used in column zero to
1433      move to the last column of the preceding line.  If this flag is
1434      not present, `le' should not be used in column zero.
1435
1436 `nw'
1437      String of commands to move the cursor to start of next line,
1438      possibly clearing rest of line (following the cursor) before
1439      moving.
1440
1441 `DO', `UP', `LE', `RI'
1442      Strings of commands to move the cursor N lines down vertically, up
1443      vertically, or N columns left or right.  Do not attempt to move
1444      past any edge of the screen with these commands; the effect of
1445      trying that is undefined.  Only a few terminal descriptions provide
1446      these commands, and most programs do not use them.
1447
1448 `CM'
1449      String of commands to position the cursor at line L, column C,
1450      relative to display memory.  Both parameters are origin-zero.
1451      This capability is present only in terminals where there is a
1452      difference between screen-relative and memory-relative addressing,
1453      and not even in all such terminals.
1454
1455 `ch'
1456      String of commands to position the cursor at column C in the same
1457      line it is on.  This is a special case of `cm' in which the
1458      vertical position is not changed.  The `ch' capability is provided
1459      only when it is faster to output than `cm' would be in this
1460      special case.  Programs should not assume most display terminals
1461      have `ch'.
1462
1463 `cv'
1464      String of commands to position the cursor at line L in the same
1465      column.  This is a special case of `cm' in which the horizontal
1466      position is not changed.  The `cv' capability is provided only
1467      when it is faster to output than `cm' would be in this special
1468      case.  Programs should not assume most display terminals have `cv'.
1469
1470 `sc'
1471      String of commands to make the terminal save the current cursor
1472      position.  Only the last saved position can be used.  If this
1473      capability is present, `rc' should be provided also.  Most
1474      terminals have neither.
1475
1476 `rc'
1477      String of commands to make the terminal restore the last saved
1478      cursor position.  If this capability is present, `sc' should be
1479      provided also.  Most terminals have neither.
1480
1481 `ff'
1482      String of commands to advance to the next page, for a hardcopy
1483      terminal.
1484
1485 `ta'
1486      String of commands to move the cursor right to the next hardware
1487      tab stop column.  Missing if the terminal does not have any kind of
1488      hardware tabs.  Do not send this command if the kernel's terminal
1489      modes say that the kernel is expanding tabs into spaces.
1490
1491 `bt'
1492      String of commands to move the cursor left to the previous hardware
1493      tab stop column.  Missing if the terminal has no such ability; many
1494      terminals do not.  Do not send this command if the kernel's
1495      terminal modes say that the kernel is expanding tabs into spaces.
1496
1497    The following obsolete capabilities should be included in terminal
1498 descriptions when appropriate, but should not be looked at by new
1499 programs.
1500
1501 `nc'
1502      Flag whose presence means the terminal does not support the ASCII
1503      carriage return character as `cr'.  This flag is needed because
1504      old programs assume, when the `cr' capability is missing, that
1505      ASCII carriage return can be used for the purpose.  We use `nc' to
1506      tell the old programs that carriage return may not be used.
1507
1508      New programs should not assume any default for `cr', so they need
1509      not look at `nc'.  However, descriptions should contain `nc'
1510      whenever they do not contain `cr'.
1511
1512 `xt'
1513      Flag whose presence means that the ASCII tab character may not be
1514      used for cursor motion.  This flag exists because old programs
1515      assume, when the `ta' capability is missing, that ASCII tab can be
1516      used for the purpose.  We use `xt' to tell the old programs not to
1517      use tab.
1518
1519      New programs should not assume any default for `ta', so they need
1520      not look at `xt' in connection with cursor motion.  Note that `xt'
1521      also has implications for standout mode (*note Standout::).  It is
1522      obsolete in regard to cursor motion but not in regard to standout.
1523
1524      In fact, `xt' means that the terminal is a Teleray 1061.
1525
1526 `bc'
1527      Very obsolete alternative name for the `le' capability.
1528
1529 `bs'
1530      Flag whose presence means that the ASCII character backspace may be
1531      used to move the cursor left.  Obsolete; look at `le' instead.
1532
1533 `nl'
1534      Obsolete capability which is a string that can either be used to
1535      move the cursor down or to scroll.  The same string must scroll
1536      when used on the bottom line and move the cursor when used on any
1537      other line.  New programs should use `do' or `sf', and ignore `nl'.
1538
1539      If there is no `nl' capability, some old programs assume they can
1540      use the newline character for this purpose.  These programs follow
1541      a bad practice, but because they exist, it is still desirable to
1542      define the `nl' capability in a terminal description if the best
1543      way to move down is _not_ a newline.
1544
1545 \1f
1546 File: termcap.info,  Node: Wrapping,  Next: Scrolling,  Prev: Cursor Motion,  Up: Capabilities
1547
1548 3.4 Wrapping
1549 ============
1550
1551 "Wrapping" means moving the cursor from the right margin to the left
1552 margin of the following line.  Some terminals wrap automatically when a
1553 graphic character is output in the last column, while others do not.
1554 Most application programs that use termcap need to know whether the
1555 terminal wraps.  There are two special flag capabilities to describe
1556 what the terminal does when a graphic character is output in the last
1557 column.
1558
1559 `am'
1560      Flag whose presence means that writing a character in the last
1561      column causes the cursor to wrap to the beginning of the next line.
1562
1563      If `am' is not present, writing in the last column leaves the
1564      cursor at the place where the character was written.
1565
1566      Writing in the last column of the last line should be avoided on
1567      terminals with `am', as it may or may not cause scrolling to occur
1568      (*note Scrolling::).  Scrolling is surely not what you would
1569      intend.
1570
1571      If your program needs to check the `am' flag, then it also needs
1572      to check the `xn' flag which indicates that wrapping happens in a
1573      strange way.  Many common terminals have the `xn' flag.
1574
1575 `xn'
1576      Flag whose presence means that the cursor wraps in a strange way.
1577      At least two distinct kinds of strange behavior are known; the
1578      termcap data base does not contain anything to distinguish the two.
1579
1580      On Concept-100 terminals, output in the last column wraps the
1581      cursor almost like an ordinary `am' terminal.  But if the next
1582      thing output is a newline, it is ignored.
1583
1584      DEC VT-100 terminals (when the wrap switch is on) do a different
1585      strange thing: the cursor wraps only if the next thing output is
1586      another graphic character.  In fact, the wrap occurs when the
1587      following graphic character is received by the terminal, before the
1588      character is placed on the screen.
1589
1590      On both of these terminals, after writing in the last column a
1591      following graphic character will be displayed in the first column
1592      of the following line.  But the effect of relative cursor motion
1593      characters such as newline or backspace at such a time depends on
1594      the terminal.  The effect of erase or scrolling commands also
1595      depends on the terminal.  You can't assume anything about what
1596      they will do on a terminal that has `xn'.  So, to be safe, you
1597      should never do these things at such a time on such a terminal.
1598
1599      To be sure of reliable results on a terminal which has the `xn'
1600      flag, output a `cm' absolute positioning command after writing in
1601      the last column.  Another safe thing to do is to output
1602      carriage-return newline, which will leave the cursor at the
1603      beginning of the following line.
1604
1605 \1f
1606 File: termcap.info,  Node: Scrolling,  Next: Windows,  Prev: Wrapping,  Up: Capabilities
1607
1608 3.5 Scrolling
1609 =============
1610
1611 "Scrolling" means moving the contents of the screen up or down one or
1612 more lines.  Moving the contents up is "forward scrolling"; moving them
1613 down is "reverse scrolling".
1614
1615    Scrolling happens after each line of output during ordinary output
1616 on most display terminals.  But in an application program that uses
1617 termcap for random-access output, scrolling happens only when
1618 explicitly requested with the commands in this section.
1619
1620    Some terminals have a "scroll region" feature.  This lets you limit
1621 the effect of scrolling to a specified range of lines.  Lines outside
1622 the range are unaffected when scrolling happens.  The scroll region
1623 feature is available if either `cs' or `cS' is present.
1624
1625 `sf'
1626      String of commands to scroll the screen one line up, assuming it is
1627      output with the cursor at the beginning of the bottom line.
1628
1629 `sr'
1630      String of commands to scroll the screen one line down, assuming it
1631      is output with the cursor at the beginning of the top line.
1632
1633 `SF'
1634      String of commands to scroll the screen N lines up, assuming it is
1635      output with the cursor at the beginning of the bottom line.
1636
1637 `SR'
1638      String of commands to scroll the screen N line down, assuming it
1639      is output with the cursor at the beginning of the top line.
1640
1641 `cs'
1642      String of commands to set the scroll region.  This command takes
1643      two parameters, START and END, which are the line numbers
1644      (origin-zero) of the first line to include in the scroll region
1645      and of the last line to include in it.  When a scroll region is
1646      set, scrolling is limited to the specified range of lines; lines
1647      outside the range are not affected by scroll commands.
1648
1649      Do not try to move the cursor outside the scroll region.  The
1650      region remains set until explicitly removed.  To remove the scroll
1651      region, use another `cs' command specifying the full height of the
1652      screen.
1653
1654      The cursor position is undefined after the `cs' command is set, so
1655      position the cursor with `cm' immediately afterward.
1656
1657 `cS'
1658      String of commands to set the scroll region using parameters in
1659      different form.  The effect is the same as if `cs' were used.
1660      Four parameters are required:
1661
1662        1. Total number of lines on the screen.
1663
1664        2. Number of lines above desired scroll region.
1665
1666        3. Number of lines below (outside of) desired scroll region.
1667
1668        4. Total number of lines on the screen, the same as the first
1669           parameter.
1670
1671      This capability is a GNU extension that was invented to allow the
1672      Ann Arbor Ambassador's scroll-region command to be described; it
1673      could also be done by putting non-Unix `%'-sequences into a `cs'
1674      string, but that would have confused Unix programs that used the
1675      `cs' capability with the Unix termcap.  Currently only GNU Emacs
1676      uses the `cS' capability.
1677
1678 `ns'
1679      Flag which means that the terminal does not normally scroll for
1680      ordinary sequential output.  For modern terminals, this means that
1681      outputting a newline in ordinary sequential output with the cursor
1682      on the bottom line wraps to the top line.  For some obsolete
1683      terminals, other things may happen.
1684
1685      The terminal may be able to scroll even if it does not normally do
1686      so.  If the `sf' capability is provided, it can be used for
1687      scrolling regardless of `ns'.
1688
1689 `da'
1690      Flag whose presence means that lines scrolled up off the top of the
1691      screen may come back if scrolling down is done subsequently.
1692
1693      The `da' and `db' flags do not, strictly speaking, affect how to
1694      scroll.  But programs that scroll usually need to clear the lines
1695      scrolled onto the screen, if these flags are present.
1696
1697 `db'
1698      Flag whose presence means that lines scrolled down off the bottom
1699      of the screen may come back if scrolling up is done subsequently.
1700
1701 `lm'
1702      Numeric value, the number of lines of display memory that the
1703      terminal has.  A value of zero means that the terminal has more
1704      display memory than can fit on the screen, but no fixed number of
1705      lines.  (The number of lines may depend on the amount of text in
1706      each line.)
1707
1708    Any terminal description that defines `SF' should also define `sf';
1709 likewise for `SR' and `sr'.  However, many terminals can only scroll by
1710 one line at a time, so it is common to find `sf' and not `SF', or `sr'
1711 without `SR'.
1712
1713    Therefore, all programs that use the scrolling facilities should be
1714 prepared to work with `sf' in the case that `SF' is absent, and
1715 likewise with `sr'.  On the other hand, an application program that
1716 uses only `sf' and not `SF' is acceptable, though slow on some
1717 terminals.
1718
1719    When outputting a scroll command with `tputs', the NLINES argument
1720 should be the total number of lines in the portion of the screen being
1721 scrolled.  Very often these commands require padding proportional to
1722 this number of lines.  *Note Padding::.
1723
1724 \1f
1725 File: termcap.info,  Node: Windows,  Next: Clearing,  Prev: Scrolling,  Up: Capabilities
1726
1727 3.6 Windows
1728 ===========
1729
1730 A "window", in termcap, is a rectangular portion of the screen to which
1731 all display operations are restricted.  Wrapping, clearing, scrolling,
1732 insertion and deletion all operate as if the specified window were all
1733 the screen there was.
1734
1735 `wi'
1736      String of commands to set the terminal output screen window.  This
1737      string requires four parameters, all origin-zero:
1738        1. The first line to include in the window.
1739
1740        2. The last line to include in the window.
1741
1742        3. The first column to include in the window.
1743
1744        4. The last column to include in the window.
1745
1746    Most terminals do not support windows.
1747
1748 \1f
1749 File: termcap.info,  Node: Clearing,  Next: Insdel Line,  Prev: Windows,  Up: Capabilities
1750
1751 3.7 Clearing Parts of the Screen
1752 ================================
1753
1754 There are several terminal capabilities for clearing parts of the screen
1755 to blank.  All display terminals support the `cl' string, and most
1756 display terminals support all of these capabilities.
1757
1758 `cl'
1759      String of commands to clear the entire screen and position the
1760      cursor at the upper left corner.
1761
1762 `cd'
1763      String of commands to clear the line the cursor is on, and all the
1764      lines below it, down to the bottom of the screen.  This command
1765      string should be used only with the cursor in column zero; their
1766      effect is undefined if the cursor is elsewhere.
1767
1768 `ce'
1769      String of commands to clear from the cursor to the end of the
1770      current line.
1771
1772 `ec'
1773      String of commands to clear N characters, starting with the
1774      character that the cursor is on.  This command string is expected
1775      to leave the cursor position unchanged.  The parameter N should
1776      never be large enough to reach past the right margin; the effect
1777      of such a large parameter would be undefined.
1778
1779    Clear to end of line (`ce') is extremely important in programs that
1780 maintain an updating display.  Nearly all display terminals support this
1781 operation, so it is acceptable for an application program to refuse to
1782 work if `ce' is not present.  However, if you do not want this
1783 limitation, you can accomplish clearing to end of line by outputting
1784 spaces until you reach the right margin.  In order to do this, you must
1785 know the current horizontal position.  Also, this technique assumes
1786 that writing a space will erase.  But this happens to be true on all
1787 the display terminals that fail to support `ce'.
1788
1789 \1f
1790 File: termcap.info,  Node: Insdel Line,  Next: Insdel Char,  Prev: Clearing,  Up: Capabilities
1791
1792 3.8 Insert/Delete Line
1793 ======================
1794
1795 "Inserting a line" means creating a blank line in the middle of the
1796 screen, and pushing the existing lines of text apart.  In fact, the
1797 lines above the insertion point do not change, while the lines below
1798 move down, and one is normally lost at the bottom of the screen.
1799
1800    "Deleting a line" means causing the line to disappear from the
1801 screen, closing up the gap by moving the lines below it upward.  A new
1802 line appears at the bottom of the screen.  Usually this line is blank,
1803 but on terminals with the `db' flag it may be a line previously moved
1804 off the screen bottom by scrolling or line insertion.
1805
1806    Insertion and deletion of lines is useful in programs that maintain
1807 an updating display some parts of which may get longer or shorter.
1808 They are also useful in editors for scrolling parts of the screen, and
1809 for redisplaying after lines of text are killed or inserted.
1810
1811    Many terminals provide commands to insert or delete a single line at
1812 the cursor position.  Some provide the ability to insert or delete
1813 several lines with one command, using the number of lines to insert or
1814 delete as a parameter.  Always move the cursor to column zero before
1815 using any of these commands.
1816
1817 `al'
1818      String of commands to insert a blank line before the line the
1819      cursor is on.  The existing line, and all lines below it, are
1820      moved down.  The last line in the screen (or in the scroll region,
1821      if one is set) disappears and in most circumstances is discarded.
1822      It may not be discarded if the `db' is present (*note Scrolling::).
1823
1824      The cursor must be at the left margin before this command is used.
1825      This command does not move the cursor.
1826
1827 `dl'
1828      String of commands to delete the line the cursor is on.  The
1829      following lines move up, and a blank line appears at the bottom of
1830      the screen (or bottom of the scroll region).  If the terminal has
1831      the `db' flag, a nonblank line previously pushed off the screen
1832      bottom may reappear at the bottom.
1833
1834      The cursor must be at the left margin before this command is used.
1835      This command does not move the cursor.
1836
1837 `AL'
1838      String of commands to insert N blank lines before the line that
1839      the cursor is on.  It is like `al' repeated N times, except that
1840      it is as fast as one `al'.
1841
1842 `DL'
1843      String of commands to delete N lines starting with the line that
1844      the cursor is on.  It is like `dl' repeated N times, except that
1845      it is as fast as one `dl'.
1846
1847    Any terminal description that defines `AL' should also define `al';
1848 likewise for `DL' and `dl'.  However, many terminals can only insert or
1849 delete one line at a time, so it is common to find `al' and not `AL',
1850 or `dl' without `DL'.
1851
1852    Therefore, all programs that use the insert and delete facilities
1853 should be prepared to work with `al' in the case that `AL' is absent,
1854 and likewise with `dl'.  On the other hand, it is acceptable to write
1855 an application that uses only `al' and `dl' and does not look for `AL'
1856 or `DL' at all.
1857
1858    If a terminal does not support line insertion and deletion directly,
1859 but does support a scroll region, the effect of insertion and deletion
1860 can be obtained with scrolling.  However, it is up to the individual
1861 user program to check for this possibility and use the scrolling
1862 commands to get the desired result.  It is fairly important to implement
1863 this alternate strategy, since it is the only way to get the effect of
1864 line insertion and deletion on the popular VT100 terminal.
1865
1866    Insertion and deletion of lines is affected by the scroll region on
1867 terminals that have a settable scroll region.  This is useful when it is
1868 desirable to move any few consecutive lines up or down by a few lines.
1869 *Note Scrolling::.
1870
1871    The line pushed off the bottom of the screen is not lost if the
1872 terminal has the `db' flag capability; instead, it is pushed into
1873 display memory that does not appear on the screen.  This is the same
1874 thing that happens when scrolling pushes a line off the bottom of the
1875 screen.  Either reverse scrolling or deletion of a line can bring the
1876 apparently lost line back onto the bottom of the screen.  If the
1877 terminal has the scroll region feature as well as `db', the pushed-out
1878 line really is lost if a scroll region is in effect.
1879
1880    When outputting an insert or delete command with `tputs', the NLINES
1881 argument should be the total number of lines from the cursor to the
1882 bottom of the screen (or scroll region).  Very often these commands
1883 require padding proportional to this number of lines.  *Note Padding::.
1884
1885    For `AL' and `DL' the NLINES argument should _not_ depend on the
1886 number of lines inserted or deleted; only the total number of lines
1887 affected.  This is because it is just as fast to insert two or N lines
1888 with `AL' as to insert one line with `al'.
1889
1890 \1f
1891 File: termcap.info,  Node: Insdel Char,  Next: Standout,  Prev: Insdel Line,  Up: Capabilities
1892
1893 3.9 Insert/Delete Character
1894 ===========================
1895
1896 "Inserting a character" means creating a blank space in the middle of a
1897 line, and pushing the rest of the line rightward.  The character in the
1898 rightmost column is lost.
1899
1900    "Deleting a character" means causing the character to disappear from
1901 the screen, closing up the gap by moving the rest of the line leftward.
1902 A blank space appears in the rightmost column.
1903
1904    Insertion and deletion of characters is useful in programs that
1905 maintain an updating display some parts of which may get longer or
1906 shorter.  It is also useful in editors for redisplaying the results of
1907 editing within a line.
1908
1909    Many terminals provide commands to insert or delete a single
1910 character at the cursor position.  Some provide the ability to insert
1911 or delete several characters with one command, using the number of
1912 characters to insert or delete as a parameter.
1913
1914    Many terminals provide an insert mode in which outputting a graphic
1915 character has the added effect of inserting a position for that
1916 character.  A special command string is used to enter insert mode and
1917 another is used to exit it.  The reason for designing a terminal with
1918 an insert mode rather than an insert command is that inserting
1919 character positions is usually followed by writing characters into
1920 them.  With insert mode, this is as fast as simply writing the
1921 characters, except for the fixed overhead of entering and leaving
1922 insert mode.  However, when the line speed is great enough, padding may
1923 be required for the graphic characters output in insert mode.
1924
1925    Some terminals require you to enter insert mode and then output a
1926 special command for each position to be inserted.  Or they may require
1927 special commands to be output before or after each graphic character to
1928 be inserted.
1929
1930    Deletion of characters is usually accomplished by a straightforward
1931 command to delete one or several positions; but on some terminals, it
1932 is necessary to enter a special delete mode before using the delete
1933 command, and leave delete mode afterward.  Sometimes delete mode and
1934 insert mode are the same mode.
1935
1936    Some terminals make a distinction between character positions in
1937 which a space character has been output and positions which have been
1938 cleared.  On these terminals, the effect of insert or delete character
1939 runs to the first cleared position rather than to the end of the line.
1940 In fact, the effect may run to more than one line if there is no
1941 cleared position to stop the shift on the first line.  These terminals
1942 are identified by the `in' flag capability.
1943
1944    On terminals with the `in' flag, the technique of skipping over
1945 characters that you know were cleared, and then outputting text later
1946 on in the same line, causes later insert and delete character
1947 operations on that line to do nonstandard things.  A program that has
1948 any chance of doing this must check for the `in' flag and must be
1949 careful to write explicit space characters into the intermediate
1950 columns when `in' is present.
1951
1952    A plethora of terminal capabilities are needed to describe all of
1953 this complexity.  Here is a list of them all.  Following the list, we
1954 present an algorithm for programs to use to take proper account of all
1955 of these capabilities.
1956
1957 `im'
1958      String of commands to enter insert mode.
1959
1960      If the terminal has no special insert mode, but it can insert
1961      characters with a special command, `im' should be defined with a
1962      null value, because the `vi' editor assumes that insertion of a
1963      character is impossible if `im' is not provided.
1964
1965      New programs should not act like `vi'.  They should pay attention
1966      to `im' only if it is defined.
1967
1968 `ei'
1969      String of commands to leave insert mode.  This capability must be
1970      present if `im' is.
1971
1972      On a few old terminals the same string is used to enter and exit
1973      insert mode.  This string turns insert mode on if it was off, and
1974      off if it was on.  You can tell these terminals because the `ei'
1975      string equals the `im' string.  If you want to support these
1976      terminals, you must always remember accurately whether insert mode
1977      is in effect.  However, these terminals are obsolete, and it is
1978      reasonable to refuse to support them.  On all modern terminals, you
1979      can safely output `ei' at any time to ensure that insert mode is
1980      turned off.
1981
1982 `ic'
1983      String of commands to insert one character position at the cursor.
1984      The cursor does not move.
1985
1986      If outputting a graphic character while in insert mode is
1987      sufficient to insert the character, then the `ic' capability
1988      should be defined with a null value.
1989
1990      If your terminal offers a choice of ways to insert--either use
1991      insert mode or use a special command--then define `im' and do not
1992      define `ic', since this gives the most efficient operation when
1993      several characters are to be inserted.  _Do not_ define both
1994      strings, for that means that _both_ must be used each time
1995      insertion is done.
1996
1997 `ip'
1998      String of commands to output following an inserted graphic
1999      character in insert mode.  Often it is used just for a padding
2000      spec, when padding is needed after an inserted character (*note
2001      Padding::).
2002
2003 `IC'
2004      String of commands to insert N character positions at and after
2005      the cursor.  It has the same effect as repeating the `ic' string
2006      and a space, N times.
2007
2008      If `IC' is provided, application programs may use it without first
2009      entering insert mode.
2010
2011 `mi'
2012      Flag whose presence means it is safe to move the cursor while in
2013      insert mode and assume the terminal remains in insert mode.
2014
2015 `in'
2016      Flag whose presence means that the terminal distinguishes between
2017      character positions in which space characters have been output and
2018      positions which have been cleared.
2019
2020    An application program can assume that the terminal can do character
2021 insertion if _any one of_ the capabilities `IC', `im', `ic' or `ip' is
2022 provided.
2023
2024    To insert N blank character positions, move the cursor to the place
2025 to insert them and follow this algorithm:
2026
2027   1. If an `IC' string is provided, output it with parameter N and you
2028      are finished.  Otherwise (or if you don't want to bother to look
2029      for an `IC' string) follow the remaining steps.
2030
2031   2. Output the `im' string, if there is one, unless the terminal is
2032      already in insert mode.
2033
2034   3. Repeat steps 4 through 6, N times.
2035
2036   4. Output the `ic' string if any.
2037
2038   5. Output a space.
2039
2040   6. Output the `ip' string if any.
2041
2042   7. Output the `ei' string, eventually, to exit insert mode.  There is
2043      no need to do this right away.  If the `mi' flag is present, you
2044      can move the cursor and the cursor will remain in insert mode;
2045      then you can do more insertion elsewhere without reentering insert
2046      mode.
2047
2048    To insert N graphic characters, position the cursor and follow this
2049 algorithm:
2050
2051   1. If an `IC' string is provided, output it with parameter N, then
2052      output the graphic characters, and you are finished.  Otherwise
2053      (or if you don't want to bother to look for an `IC' string) follow
2054      the remaining steps.
2055
2056   2. Output the `im' string, if there is one, unless the terminal is
2057      already in insert mode.
2058
2059   3. For each character to be output, repeat steps 4 through 6.
2060
2061   4. Output the `ic' string if any.
2062
2063   5. Output the next graphic character.
2064
2065   6. Output the `ip' string if any.
2066
2067   7. Output the `ei' string, eventually, to exit insert mode.  There is
2068      no need to do this right away.  If the `mi' flag is present, you
2069      can move the cursor and the cursor will remain in insert mode;
2070      then you can do more insertion elsewhere without reentering insert
2071      mode.
2072
2073    Note that this is not the same as the original Unix termcap
2074 specifications in one respect: it assumes that the `IC' string can be
2075 used without entering insert mode.  This is true as far as I know, and
2076 it allows you be able to avoid entering and leaving insert mode, and
2077 also to be able to avoid the inserted-character padding after the
2078 characters that go into the inserted positions.
2079
2080    Deletion of characters is less complicated; deleting one column is
2081 done by outputting the `dc' string.  However, there may be a delete
2082 mode that must be entered with `dm' in order to make `dc' work.
2083
2084 `dc'
2085      String of commands to delete one character position at the cursor.
2086      If `dc' is not present, the terminal cannot delete characters.
2087
2088 `DC'
2089      String of commands to delete N characters starting at the cursor.
2090      It has the same effect as repeating the `dc' string N times.  Any
2091      terminal description that has `DC' also has `dc'.
2092
2093 `dm'
2094      String of commands to enter delete mode.  If not present, there is
2095      no delete mode, and `dc' can be used at any time (assuming there is
2096      a `dc').
2097
2098 `ed'
2099      String of commands to exit delete mode.  This must be present if
2100      `dm' is.
2101
2102    To delete N character positions, position the cursor and follow these
2103 steps:
2104
2105   1. If the `DC' string is present, output it with parameter N and you
2106      are finished.  Otherwise, follow the remaining steps.
2107
2108   2. Output the `dm' string, unless you know the terminal is already in
2109      delete mode.
2110
2111   3. Output the `dc' string N times.
2112
2113   4. Output the `ed' string eventually.  If the flag capability `mi' is
2114      present, you can move the cursor and do more deletion without
2115      leaving and reentering delete mode.
2116
2117    As with the `IC' string, we have departed from the original termcap
2118 specifications by assuming that `DC' works without entering delete mode
2119 even though `dc' would not.
2120
2121    If the `dm' and `im' capabilities are both present and have the same
2122 value, it means that the terminal has one mode for both insertion and
2123 deletion.  It is useful for a program to know this, because then it can
2124 do insertions after deletions, or vice versa, without leaving
2125 insert/delete mode and reentering it.
2126
2127 \1f
2128 File: termcap.info,  Node: Standout,  Next: Underlining,  Prev: Insdel Char,  Up: Capabilities
2129
2130 3.10 Standout and Appearance Modes
2131 ==================================
2132
2133 "Appearance modes" are modifications to the ways characters are
2134 displayed.  Typical appearance modes include reverse video, dim, bright,
2135 blinking, underlined, invisible, and alternate character set.  Each
2136 kind of terminal supports various among these, or perhaps none.
2137
2138    For each type of terminal, one appearance mode or combination of
2139 them that looks good for highlighted text is chosen as the "standout
2140 mode".  The capabilities `so' and `se' say how to enter and leave
2141 standout mode.  Programs that use appearance modes only to highlight
2142 some text generally use the standout mode so that they can work on as
2143 many terminals as possible.  Use of specific appearance modes other
2144 than "underlined" and "alternate character set" is rare.
2145
2146    Terminals that implement appearance modes fall into two general
2147 classes as to how they do it.
2148
2149    In some terminals, the presence or absence of any appearance mode is
2150 recorded separately for each character position.  In these terminals,
2151 each graphic character written is given the appearance modes current at
2152 the time it is written, and keeps those modes until it is erased or
2153 overwritten.  There are special commands to turn the appearance modes
2154 on or off for characters to be written in the future.
2155
2156    In other terminals, the change of appearance modes is represented by
2157 a marker that belongs to a certain screen position but affects all
2158 following screen positions until the next marker.  These markers are
2159 traditionally called "magic cookies".
2160
2161    The same capabilities (`so', `se', `mb' and so on) for turning
2162 appearance modes on and off are used for both magic-cookie terminals
2163 and per-character terminals.  On magic cookie terminals, these give the
2164 commands to write the magic cookies.  On per-character terminals, they
2165 change the current modes that affect future output and erasure.  Some
2166 simple applications can use these commands without knowing whether or
2167 not they work by means of cookies.
2168
2169    However, a program that maintains and updates a display needs to know
2170 whether the terminal uses magic cookies, and exactly what their effect
2171 is.  This information comes from the `sg' capability.
2172
2173    The `sg' capability is a numeric capability whose presence indicates
2174 that the terminal uses magic cookies for appearance modes.  Its value is
2175 the number of character positions that a magic cookie occupies.  Usually
2176 the cookie occupies one or more character positions on the screen, and
2177 these character positions are displayed as blank, but in some terminals
2178 the cookie has zero width.
2179
2180    The `sg' capability describes both the magic cookie to turn standout
2181 on and the cookie to turn it off.  This makes the assumption that both
2182 kinds of cookie have the same width on the screen.  If that is not true,
2183 the narrower cookie must be "widened" with spaces until it has the same
2184 width as the other.
2185
2186    On some magic cookie terminals, each line always starts with normal
2187 display; in other words, the scope of a magic cookie never extends over
2188 more than one line.  But on other terminals, one magic cookie affects
2189 all the lines below it unless explicitly canceled.  Termcap does not
2190 define any way to distinguish these two ways magic cookies can work.
2191 To be safe, it is best to put a cookie at the beginning of each line.
2192
2193    On some per-character terminals, standout mode or other appearance
2194 modes may be canceled by moving the cursor.  On others, moving the
2195 cursor has no effect on the state of the appearance modes.  The latter
2196 class of terminals are given the flag capability `ms' ("can move in
2197 standout").  All programs that might have occasion to move the cursor
2198 while appearance modes are turned on must check for this flag; if it is
2199 not present, they should reset appearance modes to normal before doing
2200 cursor motion.
2201
2202    A program that has turned on only standout mode should use `se' to
2203 reset the standout mode to normal.  A program that has turned on only
2204 alternate character set mode should use `ae' to return it to normal.
2205 If it is possible that any other appearance modes are turned on, use the
2206 `me' capability to return them to normal.
2207
2208    Note that the commands to turn on one appearance mode, including `so'
2209 and `mb' ... `mr', if used while some other appearance modes are turned
2210 on, may combine the two modes on some terminals but may turn off the
2211 mode previously enabled on other terminals.  This is because some
2212 terminals do not have a command to set or clear one appearance mode
2213 without changing the others.  Programs should not attempt to use
2214 appearance modes in combination except with `sa', and when switching
2215 from one single mode to another should always turn off the previously
2216 enabled mode and then turn on the new desired mode.
2217
2218    On some old terminals, the `so' and `se' commands may be the same
2219 command, which has the effect of turning standout on if it is off, or
2220 off it is on.  It is therefore risky for a program to output extra `se'
2221 commands for good measure.  Fortunately, all these terminals are
2222 obsolete.
2223
2224    Programs that update displays in which standout-text may be replaced
2225 with non-standout text must check for the `xs' flag.  In a per-character
2226 terminal, this flag says that the only way to remove standout once
2227 written is to clear that portion of the line with the `ce' string or
2228 something even more powerful (*note Clearing::); just writing new
2229 characters at those screen positions will not change the modes in
2230 effect there.  In a magic cookie terminal, `xs' says that the only way
2231 to remove a cookie is to clear a portion of the line that includes the
2232 cookie; writing a different cookie at the same position does not work.
2233
2234    Such programs must also check for the `xt' flag, which means that the
2235 terminal is a Teleray 1061.  On this terminal it is impossible to
2236 position the cursor at the front of a magic cookie, so the only two
2237 ways to remove a cookie are (1) to delete the line it is on or (2) to
2238 position the cursor at least one character before it (possibly on a
2239 previous line) and output the `se' string, which on these terminals
2240 finds and removes the next `so' magic cookie on the screen.  (It may
2241 also be possible to remove a cookie which is not at the beginning of a
2242 line by clearing that line.)  The `xt' capability also has implications
2243 for the use of tab characters, but in that regard it is obsolete (*note
2244 Cursor Motion::).
2245
2246 `so'
2247      String of commands to enter standout mode.
2248
2249 `se'
2250      String of commands to leave standout mode.
2251
2252 `sg'
2253      Numeric capability, the width on the screen of the magic cookie.
2254      This capability is absent in terminals that record appearance modes
2255      character by character.
2256
2257 `ms'
2258      Flag whose presence means that it is safe to move the cursor while
2259      the appearance modes are not in the normal state.  If this flag is
2260      absent, programs should always reset the appearance modes to
2261      normal before moving the cursor.
2262
2263 `xs'
2264      Flag whose presence means that the only way to reset appearance
2265      modes already on the screen is to clear to end of line.  On a
2266      per-character terminal, you must clear the area where the modes
2267      are set.  On a magic cookie terminal, you must clear an area
2268      containing the cookie.  See the discussion above.
2269
2270 `xt'
2271      Flag whose presence means that the cursor cannot be positioned
2272      right in front of a magic cookie, and that `se' is a command to
2273      delete the next magic cookie following the cursor.  See discussion
2274      above.
2275
2276 `mb'
2277      String of commands to enter blinking mode.
2278
2279 `md'
2280      String of commands to enter double-bright mode.
2281
2282 `mh'
2283      String of commands to enter half-bright mode.
2284
2285 `mk'
2286      String of commands to enter invisible mode.
2287
2288 `mp'
2289      String of commands to enter protected mode.
2290
2291 `mr'
2292      String of commands to enter reverse-video mode.
2293
2294 `me'
2295      String of commands to turn off all appearance modes, including
2296      standout mode and underline mode.  On some terminals it also turns
2297      off alternate character set mode; on others, it may not.  This
2298      capability must be present if any of `mb' ... `mr' is present.
2299
2300 `as'
2301      String of commands to turn on alternate character set mode.  This
2302      mode assigns some or all graphic characters an alternate picture
2303      on the screen.  There is no standard as to what the alternate
2304      pictures look like.
2305
2306 `ae'
2307      String of commands to turn off alternate character set mode.
2308
2309 `sa'
2310      String of commands to turn on an arbitrary combination of
2311      appearance modes.  It accepts 9 parameters, each of which controls
2312      a particular kind of appearance mode.  A parameter should be 1 to
2313      turn its appearance mode on, or zero to turn that mode off.  Most
2314      terminals do not support the `sa' capability, even among those
2315      that do have various appearance modes.
2316
2317      The nine parameters are, in order, STANDOUT, UNDERLINE, REVERSE,
2318      BLINK, HALF-BRIGHT, DOUBLE-BRIGHT, BLANK, PROTECT, ALT CHAR SET.
2319
2320 \1f
2321 File: termcap.info,  Node: Underlining,  Next: Cursor Visibility,  Prev: Standout,  Up: Capabilities
2322
2323 3.11 Underlining
2324 ================
2325
2326 Underlining on most terminals is a kind of appearance mode, much like
2327 standout mode.  Therefore, it may be implemented using magic cookies or
2328 as a flag in the terminal whose current state affects each character
2329 that is output.  *Note Standout::, for a full explanation.
2330
2331    The `ug' capability is a numeric capability whose presence indicates
2332 that the terminal uses magic cookies for underlining.  Its value is the
2333 number of character positions that a magic cookie for underlining
2334 occupies; it is used for underlining just as `sg' is used for standout.
2335 Aside from the simplest applications, it is impossible to use
2336 underlining correctly without paying attention to the value of `ug'.
2337
2338 `us'
2339      String of commands to turn on underline mode or to output a magic
2340      cookie to start underlining.
2341
2342 `ue'
2343      String of commands to turn off underline mode or to output a magic
2344      cookie to stop underlining.
2345
2346 `ug'
2347      Width of magic cookie that represents a change of underline mode;
2348      or missing, if the terminal does not use a magic cookie for this.
2349
2350 `ms'
2351      Flag whose presence means that it is safe to move the cursor while
2352      the appearance modes are not in the normal state.  Underlining is
2353      an appearance mode.  If this flag is absent, programs should
2354      always turn off underlining before moving the cursor.
2355
2356    There are two other, older ways of doing underlining: there can be a
2357 command to underline a single character, or the output of `_', the
2358 ASCII underscore character, as an overstrike could cause a character to
2359 be underlined.  New programs need not bother to handle these
2360 capabilities unless the author cares strongly about the obscure
2361 terminals which support them.  However, terminal descriptions should
2362 provide these capabilities when appropriate.
2363
2364 `uc'
2365      String of commands to underline the character under the cursor, and
2366      move the cursor right.
2367
2368 `ul'
2369      Flag whose presence means that the terminal can underline by
2370      overstriking an underscore character (`_'); some terminals can do
2371      this even though they do not support overstriking in general.  An
2372      implication of this flag is that when outputting new text to
2373      overwrite old text, underscore characters must be treated
2374      specially lest they underline the old text instead.
2375
2376 \1f
2377 File: termcap.info,  Node: Cursor Visibility,  Next: Bell,  Prev: Underlining,  Up: Capabilities
2378
2379 3.12 Cursor Visibility
2380 ======================
2381
2382 Some terminals have the ability to make the cursor invisible, or to
2383 enhance it.  Enhancing the cursor is often done by programs that plan
2384 to use the cursor to indicate to the user a position of interest that
2385 may be anywhere on the screen--for example, the Emacs editor enhances
2386 the cursor on entry.  Such programs should always restore the cursor to
2387 normal on exit.
2388
2389 `vs'
2390      String of commands to enhance the cursor.
2391
2392 `vi'
2393      String of commands to make the cursor invisible.
2394
2395 `ve'
2396      String of commands to return the cursor to normal.
2397
2398    If you define either `vs' or `vi', you must also define `ve'.
2399
2400 \1f
2401 File: termcap.info,  Node: Bell,  Next: Keypad,  Prev: Cursor Visibility,  Up: Capabilities
2402
2403 3.13 Bell
2404 =========
2405
2406 Here we describe commands to make the terminal ask for the user to pay
2407 attention to it.
2408
2409 `bl'
2410      String of commands to cause the terminal to make an audible sound.
2411      If this capability is absent, the terminal has no way to make a
2412      suitable sound.
2413
2414 `vb'
2415      String of commands to cause the screen to flash to attract
2416      attention ("visible bell").  If this capability is absent, the
2417      terminal has no way to do such a thing.
2418
2419 \1f
2420 File: termcap.info,  Node: Keypad,  Next: Meta Key,  Prev: Bell,  Up: Capabilities
2421
2422 3.14 Keypad and Function Keys
2423 =============================
2424
2425 Many terminals have arrow and function keys that transmit specific
2426 character sequences to the computer.  Since the precise sequences used
2427 depend on the terminal, termcap defines capabilities used to say what
2428 the sequences are.  Unlike most termcap string-valued capabilities,
2429 these are not strings of commands to be sent to the terminal, rather
2430 strings that are received from the terminal.
2431
2432    Programs that expect to use keypad keys should check, initially, for
2433 a `ks' capability and send it, to make the keypad actually transmit.
2434 Such programs should also send the `ke' string when exiting.
2435
2436 `ks'
2437      String of commands to make the function keys transmit.  If this
2438      capability is not provided, but the others in this section are,
2439      programs may assume that the function keys always transmit.
2440
2441 `ke'
2442      String of commands to make the function keys work locally.  This
2443      capability is provided only if `ks' is.
2444
2445 `kl'
2446      String of input characters sent by typing the left-arrow key.  If
2447      this capability is missing, you cannot expect the terminal to have
2448      a left-arrow key that transmits anything to the computer.
2449
2450 `kr'
2451      String of input characters sent by typing the right-arrow key.
2452
2453 `ku'
2454      String of input characters sent by typing the up-arrow key.
2455
2456 `kd'
2457      String of input characters sent by typing the down-arrow key.
2458
2459 `kh'
2460      String of input characters sent by typing the "home-position" key.
2461
2462 `K1' ... `K5'
2463      Strings of input characters sent by the five other keys in a 3-by-3
2464      array that includes the arrow keys, if the keyboard has such a
2465      3-by-3 array.  Note that one of these keys may be the
2466      "home-position" key, in which case one of these capabilities will
2467      have the same value as the `kh' key.
2468
2469 `k0'
2470      String of input characters sent by function key 10 (or 0, if the
2471      terminal has one labeled 0).
2472
2473 `k1' ... `k9'
2474      Strings of input characters sent by function keys 1 through 9,
2475      provided for those function keys that exist.
2476
2477 `kn'
2478      Number: the number of numbered function keys, if there are more
2479      than 10.
2480
2481 `l0' ... `l9'
2482      Strings which are the labels appearing on the keyboard on the keys
2483      described by the capabilities `k0' ... `l9'.  These capabilities
2484      should be left undefined if the labels are `f0' or `f10' and `f1'
2485      ... `f9'.
2486
2487 `kH'
2488      String of input characters sent by the "home down" key, if there is
2489      one.
2490
2491 `kb'
2492      String of input characters sent by the "backspace" key, if there is
2493      one.
2494
2495 `ka'
2496      String of input characters sent by the "clear all tabs" key, if
2497      there is one.
2498
2499 `kt'
2500      String of input characters sent by the "clear tab stop this column"
2501      key, if there is one.
2502
2503 `kC'
2504      String of input characters sent by the "clear screen" key, if
2505      there is one.
2506
2507 `kD'
2508      String of input characters sent by the "delete character" key, if
2509      there is one.
2510
2511 `kL'
2512      String of input characters sent by the "delete line" key, if there
2513      is one.
2514
2515 `kM'
2516      String of input characters sent by the "exit insert mode" key, if
2517      there is one.
2518
2519 `kE'
2520      String of input characters sent by the "clear to end of line" key,
2521      if there is one.
2522
2523 `kS'
2524      String of input characters sent by the "clear to end of screen"
2525      key, if there is one.
2526
2527 `kI'
2528      String of input characters sent by the "insert character" or "enter
2529      insert mode" key, if there is one.
2530
2531 `kA'
2532      String of input characters sent by the "insert line" key, if there
2533      is one.
2534
2535 `kN'
2536      String of input characters sent by the "next page" key, if there is
2537      one.
2538
2539 `kP'
2540      String of input characters sent by the "previous page" key, if
2541      there is one.
2542
2543 `kF'
2544      String of input characters sent by the "scroll forward" key, if
2545      there is one.
2546
2547 `kR'
2548      String of input characters sent by the "scroll reverse" key, if
2549      there is one.
2550
2551 `kT'
2552      String of input characters sent by the "set tab stop in this
2553      column" key, if there is one.
2554
2555 `ko'
2556      String listing the other function keys the terminal has.  This is a
2557      very obsolete way of describing the same information found in the
2558      `kH' ... `kT' keys.  The string contains a list of two-character
2559      termcap capability names, separated by commas.  The meaning is
2560      that for each capability name listed, the terminal has a key which
2561      sends the string which is the value of that capability.  For
2562      example, the value `:ko=cl,ll,sf,sr:' says that the terminal has
2563      four function keys which mean "clear screen", "home down", "scroll
2564      forward" and "scroll reverse".
2565
2566 \1f
2567 File: termcap.info,  Node: Meta Key,  Next: Initialization,  Prev: Keypad,  Up: Capabilities
2568
2569 3.15 Meta Key
2570 =============
2571
2572 A Meta key is a key on the keyboard that modifies each character you
2573 type by controlling the 0200 bit.  This bit is on if and only if the
2574 Meta key is held down when the character is typed.  Characters typed
2575 using the Meta key are called Meta characters.  Emacs uses Meta
2576 characters as editing commands.
2577
2578 `km'
2579      Flag whose presence means that the terminal has a Meta key.
2580
2581 `mm'
2582      String of commands to enable the functioning of the Meta key.
2583
2584 `mo'
2585      String of commands to disable the functioning of the Meta key.
2586
2587    If the terminal has `km' but does not have `mm' and `mo', it means
2588 that the Meta key always functions.  If it has `mm' and `mo', it means
2589 that the Meta key can be turned on or off.  Send the `mm' string to
2590 turn it on, and the `mo' string to turn it off.  I do not know why one
2591 would ever not want it to be on.
2592
2593 \1f
2594 File: termcap.info,  Node: Initialization,  Next: Pad Specs,  Prev: Meta Key,  Up: Capabilities
2595
2596 3.16 Initialization
2597 ===================
2598
2599 `ti'
2600      String of commands to put the terminal into whatever special modes
2601      are needed or appropriate for programs that move the cursor
2602      nonsequentially around the screen.  Programs that use termcap to do
2603      full-screen display should output this string when they start up.
2604
2605 `te'
2606      String of commands to undo what is done by the `ti' string.
2607      Programs that output the `ti' string on entry should output this
2608      string when they exit.
2609
2610 `is'
2611      String of commands to initialize the terminal for each login
2612      session.
2613
2614 `if'
2615      String which is the name of a file containing the string of
2616      commands to initialize the terminal for each session of use.
2617      Normally `is' and `if' are not both used.
2618
2619 `i1'
2620 `i3'
2621      Two more strings of commands to initialize the terminal for each
2622      login session.  The `i1' string (if defined) is output before `is'
2623      or `if', and the `i3' string (if defined) is output after.
2624
2625      The reason for having three separate initialization strings is to
2626      make it easier to define a group of related terminal types with
2627      slightly different initializations.  Define two or three of the
2628      strings in the basic type; then the other types can override one
2629      or two of the strings.
2630
2631 `rs'
2632      String of commands to reset the terminal from any strange mode it
2633      may be in.  Normally this includes the `is' string (or other
2634      commands with the same effects) and more.  What would go in the
2635      `rs' string but not in the `is' string are annoying or slow
2636      commands to bring the terminal back from strange modes that nobody
2637      would normally use.
2638
2639 `it'
2640      Numeric value, the initial spacing between hardware tab stop
2641      columns when the terminal is powered up.  Programs to initialize
2642      the terminal can use this to decide whether there is a need to set
2643      the tab stops.  If the initial width is 8, well and good; if it is
2644      not 8, then the tab stops should be set; if they cannot be set,
2645      the kernel is told to convert tabs to spaces, and other programs
2646      will observe this and do likewise.
2647
2648 `ct'
2649      String of commands to clear all tab stops.
2650
2651 `st'
2652      String of commands to set tab stop at current cursor column on all
2653      lines.
2654
2655 \1f
2656 File: termcap.info,  Node: Pad Specs,  Next: Status Line,  Prev: Initialization,  Up: Capabilities
2657
2658 3.17 Padding Capabilities
2659 =========================
2660
2661 There are two terminal capabilities that exist just to explain the
2662 proper way to obey the padding specifications in all the command string
2663 capabilities.  One, `pc', must be obeyed by all termcap-using programs.
2664
2665 `pb'
2666      Numeric value, the lowest baud rate at which padding is actually
2667      needed.  Programs may check this and refrain from doing any
2668      padding at lower speeds.
2669
2670 `pc'
2671      String of commands for padding.  The first character of this
2672      string is to be used as the pad character, instead of using null
2673      characters for padding.  If `pc' is not provided, use null
2674      characters.  Every program that uses termcap must look up this
2675      capability and use it to set the variable `PC' that is used by
2676      `tputs'.  *Note Padding::.
2677
2678    Some termcap capabilities exist just to specify the amount of
2679 padding that the kernel should give to cursor motion commands used in
2680 ordinary sequential output.
2681
2682 `dC'
2683      Numeric value, the number of msec of padding needed for the
2684      carriage-return character.
2685
2686 `dN'
2687      Numeric value, the number of msec of padding needed for the newline
2688      (linefeed) character.
2689
2690 `dB'
2691      Numeric value, the number of msec of padding needed for the
2692      backspace character.
2693
2694 `dF'
2695      Numeric value, the number of msec of padding needed for the
2696      formfeed character.
2697
2698 `dT'
2699      Numeric value, the number of msec of padding needed for the tab
2700      character.
2701
2702    In some systems, the kernel uses the above capabilities; in other
2703 systems, the kernel uses the paddings specified in the string
2704 capabilities `cr', `sf', `le', `ff' and `ta'.  Descriptions of
2705 terminals which require such padding should contain the `dC' ...  `dT'
2706 capabilities and also specify the appropriate padding in the
2707 corresponding string capabilities.  Since no modern terminals require
2708 padding for ordinary sequential output, you probably won't need to do
2709 either of these things.
2710
2711 \1f
2712 File: termcap.info,  Node: Status Line,  Next: Half-Line,  Prev: Pad Specs,  Up: Capabilities
2713
2714 3.18 Status Line
2715 ================
2716
2717 A "status line" is a line on the terminal that is not used for ordinary
2718 display output but instead used for a special message.  The intended
2719 use is for a continuously updated description of what the user's
2720 program is doing, and that is where the name "status line" comes from,
2721 but in fact it could be used for anything.  The distinguishing
2722 characteristic of a status line is that ordinary output to the terminal
2723 does not affect it; it changes only if the special status line commands
2724 of this section are used.
2725
2726 `hs'
2727      Flag whose presence means that the terminal has a status line.  If
2728      a terminal description specifies that there is a status line, it
2729      must provide the `ts' and `fs' capabilities.
2730
2731 `ts'
2732      String of commands to move the terminal cursor into the status
2733      line.  Usually these commands must specifically record the old
2734      cursor position for the sake of the `fs' string.
2735
2736 `fs'
2737      String of commands to move the cursor back from the status line to
2738      its previous position (outside the status line).
2739
2740 `es'
2741      Flag whose presence means that other display commands work while
2742      writing the status line.  In other words, one can clear parts of
2743      it, insert or delete characters, move the cursor within it using
2744      `ch' if there is a `ch' capability, enter and leave standout mode,
2745      and so on.
2746
2747 `ds'
2748      String of commands to disable the display of the status line.  This
2749      may be absent, if there is no way to disable the status line
2750      display.
2751
2752 `ws'
2753      Numeric value, the width of the status line.  If this capability is
2754      absent in a terminal that has a status line, it means the status
2755      line is the same width as the other lines.
2756
2757      Note that the value of `ws' is sometimes as small as 8.
2758
2759 \1f
2760 File: termcap.info,  Node: Half-Line,  Next: Printer,  Prev: Status Line,  Up: Capabilities
2761
2762 3.19 Half-Line Motion
2763 =====================
2764
2765 Some terminals have commands for moving the cursor vertically by
2766 half-lines, useful for outputting subscripts and superscripts.  Mostly
2767 it is hardcopy terminals that have such features.
2768
2769 `hu'
2770      String of commands to move the cursor up half a line.  If the
2771      terminal is a display, it is your responsibility to avoid moving
2772      up past the top line; however, most likely the terminal that
2773      supports this is a hardcopy terminal and there is nothing to be
2774      concerned about.
2775
2776 `hd'
2777      String of commands to move the cursor down half a line.  If the
2778      terminal is a display, it is your responsibility to avoid moving
2779      down past the bottom line, etc.
2780
2781 \1f
2782 File: termcap.info,  Node: Printer,  Prev: Half-Line,  Up: Capabilities
2783
2784 3.20 Controlling Printers Attached to Terminals
2785 ===============================================
2786
2787 Some terminals have attached hardcopy printer ports.  They may be able
2788 to copy the screen contents to the printer; they may also be able to
2789 redirect output to the printer.  Termcap does not have anything to tell
2790 the program whether the redirected output appears also on the screen;
2791 it does on some terminals but not all.
2792
2793 `ps'
2794      String of commands to cause the contents of the screen to be
2795      printed.  If it is absent, the screen contents cannot be printed.
2796
2797 `po'
2798      String of commands to redirect further output to the printer.
2799
2800 `pf'
2801      String of commands to terminate redirection of output to the
2802      printer.  This capability must be present in the description if
2803      `po' is.
2804
2805 `pO'
2806      String of commands to redirect output to the printer for next N
2807      characters of output, regardless of what they are.  Redirection
2808      will end automatically after N characters of further output.  Until
2809      then, nothing that is output can end redirection, not even the
2810      `pf' string if there is one.  The number N should not be more than
2811      255.
2812
2813      One use of this capability is to send non-text byte sequences
2814      (such as bit-maps) to the printer.
2815
2816    Most terminals with printers do not support all of `ps', `po' and
2817 `pO'; any one or two of them may be supported.  To make a program that
2818 can send output to all kinds of printers, it is necessary to check for
2819 all three of these capabilities, choose the most convenient of the ones
2820 that are provided, and use it in its own appropriate fashion.
2821
2822 \1f
2823 File: termcap.info,  Node: Summary,  Next: Var Index,  Prev: Capabilities,  Up: Top
2824
2825 4 Summary of Capability Names
2826 *****************************
2827
2828 Here are all the terminal capability names in alphabetical order with a
2829 brief description of each.  For cross references to their definitions,
2830 see the index of capability names (*note Cap Index::).
2831
2832 `ae'
2833      String to turn off alternate character set mode.
2834
2835 `al'
2836      String to insert a blank line before the cursor.
2837
2838 `AL'
2839      String to insert N blank lines before the cursor.
2840
2841 `am'
2842      Flag: output to last column wraps cursor to next line.
2843
2844 `as'
2845      String to turn on alternate character set mode.like.
2846
2847 `bc'
2848      Very obsolete alternative name for the `le' capability.
2849
2850 `bl'
2851      String to sound the bell.
2852
2853 `bs'
2854      Obsolete flag: ASCII backspace may be used for leftward motion.
2855
2856 `bt'
2857      String to move the cursor left to the previous hardware tab stop
2858      column.
2859
2860 `bw'
2861      Flag: `le' at left margin wraps to end of previous line.
2862
2863 `CC'
2864      String to change terminal's command character.
2865
2866 `cd'
2867      String to clear the line the cursor is on, and following lines.
2868
2869 `ce'
2870      String to clear from the cursor to the end of the line.
2871
2872 `ch'
2873      String to position the cursor at column C in the same line.
2874
2875 `cl'
2876      String to clear the entire screen and put cursor at upper left
2877      corner.
2878
2879 `cm'
2880      String to position the cursor at line L, column C.
2881
2882 `CM'
2883      String to position the cursor at line L, column C, relative to
2884      display memory.
2885
2886 `co'
2887      Number: width of the screen.
2888
2889 `cr'
2890      String to move cursor sideways to left margin.
2891
2892 `cs'
2893      String to set the scroll region.
2894
2895 `cS'
2896      Alternate form of string to set the scroll region.
2897
2898 `ct'
2899      String to clear all tab stops.
2900
2901 `cv'
2902      String to position the cursor at line L in the same column.
2903
2904 `da'
2905      Flag: data scrolled off top of screen may be scrolled back.
2906
2907 `db'
2908      Flag: data scrolled off bottom of screen may be scrolled back.
2909
2910 `dB'
2911      Obsolete number: msec of padding needed for the backspace
2912      character.
2913
2914 `dc'
2915      String to delete one character position at the cursor.
2916
2917 `dC'
2918      Obsolete number: msec of padding needed for the carriage-return
2919      character.
2920
2921 `DC'
2922      String to delete N characters starting at the cursor.
2923
2924 `dF'
2925      Obsolete number: msec of padding needed for the formfeed character.
2926
2927 `dl'
2928      String to delete the line the cursor is on.
2929
2930 `DL'
2931      String to delete N lines starting with the cursor's line.
2932
2933 `dm'
2934      String to enter delete mode.
2935
2936 `dN'
2937      Obsolete number: msec of padding needed for the newline character.
2938
2939 `do'
2940      String to move the cursor vertically down one line.
2941
2942 `DO'
2943      String to move cursor vertically down N lines.
2944
2945 `ds'
2946      String to disable the display of the status line.
2947
2948 `dT'
2949      Obsolete number: msec of padding needed for the tab character.
2950
2951 `ec'
2952      String of commands to clear N characters at cursor.
2953
2954 `ed'
2955      String to exit delete mode.
2956
2957 `ei'
2958      String to leave insert mode.
2959
2960 `eo'
2961      Flag: output of a space can erase an overstrike.
2962
2963 `es'
2964      Flag: other display commands work while writing the status line.
2965
2966 `ff'
2967      String to advance to the next page, for a hardcopy terminal.
2968
2969 `fs'
2970      String to move the cursor back from the status line to its
2971      previous position (outside the status line).
2972
2973 `gn'
2974      Flag: this terminal type is generic, not real.
2975
2976 `hc'
2977      Flag: hardcopy terminal.
2978
2979 `hd'
2980      String to move the cursor down half a line.
2981
2982 `ho'
2983      String to position cursor at upper left corner.
2984
2985 `hs'
2986      Flag: the terminal has a status line.
2987
2988 `hu'
2989      String to move the cursor up half a line.
2990
2991 `hz'
2992      Flag: terminal cannot accept `~' as output.
2993
2994 `i1'
2995      String to initialize the terminal for each login session.
2996
2997 `i3'
2998      String to initialize the terminal for each login session.
2999
3000 `ic'
3001      String to insert one character position at the cursor.
3002
3003 `IC'
3004      String to insert N character positions at the cursor.
3005
3006 `if'
3007      String naming a file of commands to initialize the terminal.
3008
3009 `im'
3010      String to enter insert mode.
3011
3012 `in'
3013      Flag: outputting a space is different from moving over empty
3014      positions.
3015
3016 `ip'
3017      String to output following an inserted character in insert mode.
3018
3019 `is'
3020      String to initialize the terminal for each login session.
3021
3022 `it'
3023      Number: initial spacing between hardware tab stop columns.
3024
3025 `k0'
3026      String of input sent by function key 0 or 10.
3027
3028 `k1 ... k9'
3029      Strings of input sent by function keys 1 through 9.
3030
3031 `K1 ... K5'
3032      Strings sent by the five other keys in 3-by-3 array with arrows.
3033
3034 `ka'
3035      String of input sent by the "clear all tabs" key.
3036
3037 `kA'
3038      String of input sent by the "insert line" key.
3039
3040 `kb'
3041      String of input sent by the "backspace" key.
3042
3043 `kC'
3044      String of input sent by the "clear screen" key.
3045
3046 `kd'
3047      String of input sent by typing the down-arrow key.
3048
3049 `kD'
3050      String of input sent by the "delete character" key.
3051
3052 `ke'
3053      String to make the function keys work locally.
3054
3055 `kE'
3056      String of input sent by the "clear to end of line" key.
3057
3058 `kF'
3059      String of input sent by the "scroll forward" key.
3060
3061 `kh'
3062      String of input sent by typing the "home-position" key.
3063
3064 `kH'
3065      String of input sent by the "home down" key.
3066
3067 `kI'
3068      String of input sent by the "insert character" or "enter insert
3069      mode" key.
3070
3071 `kl'
3072      String of input sent by typing the left-arrow key.
3073
3074 `kL'
3075      String of input sent by the "delete line" key.
3076
3077 `km'
3078      Flag: the terminal has a Meta key.
3079
3080 `kM'
3081      String of input sent by the "exit insert mode" key.
3082
3083 `kn'
3084      Numeric value, the number of numbered function keys.
3085
3086 `kN'
3087      String of input sent by the "next page" key.
3088
3089 `ko'
3090      Very obsolete string listing the terminal's named function keys.
3091
3092 `kP'
3093      String of input sent by the "previous page" key.
3094
3095 `kr'
3096      String of input sent by typing the right-arrow key.
3097
3098 `kR'
3099      String of input sent by the "scroll reverse" key.
3100
3101 `ks'
3102      String to make the function keys transmit.
3103
3104 `kS'
3105      String of input sent by the "clear to end of screen" key.
3106
3107 `kt'
3108      String of input sent by the "clear tab stop this column" key.
3109
3110 `kT'
3111      String of input sent by the "set tab stop in this column" key.
3112
3113 `ku'
3114      String of input sent by typing the up-arrow key.
3115
3116 `l0'
3117      String on keyboard labelling function key 0 or 10.
3118
3119 `l1 ... l9'
3120      Strings on keyboard labelling function keys 1 through 9.
3121
3122 `le'
3123      String to move the cursor left one column.
3124
3125 `LE'
3126      String to move cursor left N columns.
3127
3128 `li'
3129      Number: height of the screen.
3130
3131 `ll'
3132      String to position cursor at lower left corner.
3133
3134 `lm'
3135      Number: lines of display memory.
3136
3137 `mb'
3138      String to enter blinking mode.
3139
3140 `md'
3141      String to enter double-bright mode.
3142
3143 `me'
3144      String to turn off all appearance modes
3145
3146 `mh'
3147      String to enter half-bright mode.
3148
3149 `mi'
3150      Flag: cursor motion in insert mode is safe.
3151
3152 `mk'
3153      String to enter invisible mode.
3154
3155 `mm'
3156      String to enable the functioning of the Meta key.
3157
3158 `mo'
3159      String to disable the functioning of the Meta key.
3160
3161 `mp'
3162      String to enter protected mode.
3163
3164 `mr'
3165      String to enter reverse-video mode.
3166
3167 `ms'
3168      Flag: cursor motion in standout mode is safe.
3169
3170 `nc'
3171      Obsolete flag: do not use ASCII carriage-return on this terminal.
3172
3173 `nd'
3174      String to move the cursor right one column.
3175
3176 `nl'
3177      Obsolete alternative name for the `do' and `sf' capabilities.
3178
3179 `ns'
3180      Flag: the terminal does not normally scroll for sequential output.
3181
3182 `nw'
3183      String to move to start of next line, possibly clearing rest of
3184      old line.
3185
3186 `os'
3187      Flag: terminal can overstrike.
3188
3189 `pb'
3190      Number: the lowest baud rate at which padding is actually needed.
3191
3192 `pc'
3193      String containing character for padding.
3194
3195 `pf'
3196      String to terminate redirection of output to the printer.
3197
3198 `po'
3199      String to redirect further output to the printer.
3200
3201 `pO'
3202      String to redirect N characters ofoutput to the printer.
3203
3204 `ps'
3205      String to print the screen on the attached printer.
3206
3207 `rc'
3208      String to move to last saved cursor position.
3209
3210 `RI'
3211      String to move cursor right N columns.
3212
3213 `rp'
3214      String to output character C repeated N times.
3215
3216 `rs'
3217      String to reset the terminal from any strange modes.
3218
3219 `sa'
3220      String to turn on an arbitrary combination of appearance modes.
3221
3222 `sc'
3223      String to save the current cursor position.
3224
3225 `se'
3226      String to leave standout mode.
3227
3228 `sf'
3229      String to scroll the screen one line up.
3230
3231 `SF'
3232      String to scroll the screen N lines up.
3233
3234 `sg'
3235      Number: width of magic standout cookie.  Absent if magic cookies
3236      are not used.
3237
3238 `so'
3239      String to enter standout mode.
3240
3241 `sr'
3242      String to scroll the screen one line down.
3243
3244 `SR'
3245      String to scroll the screen N line down.
3246
3247 `st'
3248      String to set tab stop at current cursor column on all lines.
3249      programs.
3250
3251 `ta'
3252      String to move the cursor right to the next hardware tab stop
3253      column.
3254
3255 `te'
3256      String to return terminal to settings for sequential output.
3257
3258 `ti'
3259      String to initialize terminal for random cursor motion.
3260
3261 `ts'
3262      String to move the terminal cursor into the status line.
3263
3264 `uc'
3265      String to underline one character and move cursor right.
3266
3267 `ue'
3268      String to turn off underline mode
3269
3270 `ug'
3271      Number: width of underlining magic cookie.  Absent if underlining
3272      doesn't use magic cookies.
3273
3274 `ul'
3275      Flag: underline by overstriking with an underscore.
3276
3277 `up'
3278      String to move the cursor vertically up one line.
3279
3280 `UP'
3281      String to move cursor vertically up N lines.
3282
3283 `us'
3284      String to turn on underline mode
3285
3286 `vb'
3287      String to make the screen flash.
3288
3289 `ve'
3290      String to return the cursor to normal.
3291
3292 `vi'
3293      String to make the cursor invisible.
3294
3295 `vs'
3296      String to enhance the cursor.
3297
3298 `wi'
3299      String to set the terminal output screen window.
3300
3301 `ws'
3302      Number: the width of the status line.
3303
3304 `xb'
3305      Flag: superbee terminal.
3306
3307 `xn'
3308      Flag: cursor wraps in a strange way.
3309
3310 `xs'
3311      Flag: clearing a line is the only way to clear the appearance
3312      modes of positions in that line (or, only way to remove magic
3313      cookies on that line).
3314
3315 `xt'
3316      Flag: Teleray 1061; several strange characteristics.
3317
3318 \1f
3319 File: termcap.info,  Node: Var Index,  Next: Cap Index,  Prev: Summary,  Up: Top
3320
3321 Variable and Function Index
3322 ***************************
3323
3324 \0\b[index\0\b]
3325 * Menu:
3326
3327 * BC:                                    tgoto.                (line 25)
3328 * ospeed:                                Output Padding.       (line 24)
3329 * PC:                                    Output Padding.       (line 24)
3330 * tgetent:                               Find.                 (line  6)
3331 * tgetflag:                              Interrogate.          (line 28)
3332 * tgetnum:                               Interrogate.          (line 28)
3333 * tgetstr:                               Interrogate.          (line 28)
3334 * tgoto:                                 tgoto.                (line  6)
3335 * tparam:                                tparam.               (line  6)
3336 * tputs:                                 Output Padding.       (line  6)
3337 * UP:                                    tgoto.                (line 25)
3338
3339 \1f
3340 File: termcap.info,  Node: Cap Index,  Next: Index,  Prev: Var Index,  Up: Top
3341
3342 Capability Index
3343 ****************
3344
3345 \0\b[index\0\b]
3346 * Menu:
3347
3348 * ae:                                    Standout.            (line 180)
3349 * AL:                                    Insdel Line.         (line  49)
3350 * al:                                    Insdel Line.         (line  29)
3351 * am:                                    Wrapping.            (line  15)
3352 * as:                                    Standout.            (line 174)
3353 * bc:                                    Cursor Motion.       (line 195)
3354 * bl:                                    Bell.                (line  10)
3355 * bs:                                    Cursor Motion.       (line 198)
3356 * bt:                                    Cursor Motion.       (line 160)
3357 * bw:                                    Cursor Motion.       (line 100)
3358 * CC:                                    Basic.               (line  65)
3359 * cd:                                    Clearing.            (line  15)
3360 * ce:                                    Clearing.            (line  21)
3361 * ch:                                    Cursor Motion.       (line 124)
3362 * cl:                                    Clearing.            (line  11)
3363 * CM:                                    Cursor Motion.       (line 117)
3364 * cm:                                    Cursor Motion.       (line  36)
3365 * co:                                    Screen Size.         (line  33)
3366 * cr:                                    Cursor Motion.       (line  65)
3367 * cS:                                    Scrolling.           (line  53)
3368 * cs:                                    Scrolling.           (line  37)
3369 * ct:                                    Initialization.      (line  56)
3370 * cv:                                    Cursor Motion.       (line 132)
3371 * da:                                    Scrolling.           (line  85)
3372 * dB:                                    Pad Specs.           (line  36)
3373 * db:                                    Scrolling.           (line  93)
3374 * dC:                                    Pad Specs.           (line  28)
3375 * DC:                                    Insdel Char.         (line 199)
3376 * dc:                                    Insdel Char.         (line 195)
3377 * dF:                                    Pad Specs.           (line  40)
3378 * DL:                                    Insdel Line.         (line  54)
3379 * dl:                                    Insdel Line.         (line  39)
3380 * dm:                                    Insdel Char.         (line 204)
3381 * dN:                                    Pad Specs.           (line  32)
3382 * DO:                                    Cursor Motion.       (line 110)
3383 * do:                                    Cursor Motion.       (line  87)
3384 * ds:                                    Status Line.         (line  37)
3385 * dT:                                    Pad Specs.           (line  44)
3386 * ec:                                    Clearing.            (line  25)
3387 * ed:                                    Insdel Char.         (line 209)
3388 * ei:                                    Insdel Char.         (line  79)
3389 * eo:                                    Basic.               (line  18)
3390 * es:                                    Status Line.         (line  30)
3391 * ff:                                    Cursor Motion.       (line 150)
3392 * fs:                                    Status Line.         (line  26)
3393 * gn:                                    Basic.               (line  23)
3394 * hc:                                    Basic.               (line  39)
3395 * hd:                                    Half-Line.           (line  18)
3396 * ho:                                    Cursor Motion.       (line  45)
3397 * hs:                                    Status Line.         (line  16)
3398 * hu:                                    Half-Line.           (line  11)
3399 * hz:                                    Basic.               (line  53)
3400 * i1:                                    Initialization.      (line  28)
3401 * i3:                                    Initialization.      (line  28)
3402 * IC:                                    Insdel Char.         (line 114)
3403 * ic:                                    Insdel Char.         (line  93)
3404 * if:                                    Initialization.      (line  22)
3405 * im:                                    Insdel Char.         (line  68)
3406 * in:                                    Insdel Char.         (line 126)
3407 * ip:                                    Insdel Char.         (line 108)
3408 * is:                                    Initialization.      (line  18)
3409 * it:                                    Initialization.      (line  47)
3410 * K1...K5:                               Keypad.              (line  44)
3411 * k1...k9:                               Keypad.              (line  55)
3412 * kA...kT:                               Keypad.              (line  69)
3413 * ka...ku:                               Keypad.              (line  18)
3414 * km:                                    Meta Key.            (line  13)
3415 * l0...l9:                               Keypad.              (line  63)
3416 * LE:                                    Cursor Motion.       (line 110)
3417 * le:                                    Cursor Motion.       (line  70)
3418 * li:                                    Screen Size.         (line  37)
3419 * ll:                                    Cursor Motion.       (line  57)
3420 * lm:                                    Scrolling.           (line  97)
3421 * mb:                                    Standout.            (line 150)
3422 * md:                                    Standout.            (line 153)
3423 * me:                                    Standout.            (line 168)
3424 * mh:                                    Standout.            (line 156)
3425 * mi:                                    Insdel Char.         (line 122)
3426 * mk:                                    Standout.            (line 159)
3427 * mm:                                    Meta Key.            (line  16)
3428 * mo:                                    Meta Key.            (line  19)
3429 * mp:                                    Standout.            (line 162)
3430 * mr:                                    Standout.            (line 165)
3431 * ms <1>:                                Underlining.         (line  31)
3432 * ms:                                    Standout.            (line 131)
3433 * nc:                                    Cursor Motion.       (line 170)
3434 * nd:                                    Cursor Motion.       (line  77)
3435 * nl:                                    Cursor Motion.       (line 202)
3436 * ns:                                    Scrolling.           (line  74)
3437 * nw:                                    Cursor Motion.       (line 105)
3438 * os:                                    Basic.               (line  11)
3439 * pb:                                    Pad Specs.           (line  11)
3440 * pc:                                    Pad Specs.           (line  16)
3441 * pf:                                    Printer.             (line  20)
3442 * pO:                                    Printer.             (line  25)
3443 * po:                                    Printer.             (line  17)
3444 * ps:                                    Printer.             (line  13)
3445 * rc:                                    Cursor Motion.       (line 145)
3446 * RI:                                    Cursor Motion.       (line 110)
3447 * rp:                                    Basic.               (line  42)
3448 * rs:                                    Initialization.      (line  39)
3449 * sa:                                    Standout.            (line 183)
3450 * sc:                                    Cursor Motion.       (line 139)
3451 * se:                                    Standout.            (line 123)
3452 * SF:                                    Scrolling.           (line  29)
3453 * sf:                                    Scrolling.           (line  21)
3454 * sg:                                    Standout.            (line 126)
3455 * so:                                    Standout.            (line 120)
3456 * SR:                                    Scrolling.           (line  33)
3457 * sr:                                    Scrolling.           (line  25)
3458 * st:                                    Initialization.      (line  59)
3459 * ta:                                    Cursor Motion.       (line 154)
3460 * te:                                    Initialization.      (line  13)
3461 * ti:                                    Initialization.      (line   7)
3462 * ts:                                    Status Line.         (line  21)
3463 * uc:                                    Underlining.         (line  45)
3464 * ue:                                    Underlining.         (line  23)
3465 * ug:                                    Underlining.         (line  27)
3466 * ul:                                    Underlining.         (line  49)
3467 * UP:                                    Cursor Motion.       (line 110)
3468 * up:                                    Cursor Motion.       (line  82)
3469 * us:                                    Underlining.         (line  19)
3470 * vb:                                    Bell.                (line  15)
3471 * ve:                                    Cursor Visibility.   (line  20)
3472 * vi:                                    Cursor Visibility.   (line  17)
3473 * vs:                                    Cursor Visibility.   (line  14)
3474 * wi:                                    Windows.             (line  12)
3475 * ws:                                    Status Line.         (line  42)
3476 * xb:                                    Basic.               (line  78)
3477 * xn:                                    Wrapping.            (line  31)
3478 * xs:                                    Standout.            (line 137)
3479 * xt <1>:                                Standout.            (line 144)
3480 * xt:                                    Cursor Motion.       (line 181)
3481
3482 \1f
3483 File: termcap.info,  Node: Index,  Prev: Cap Index,  Up: Top
3484
3485 Concept Index
3486 *************
3487
3488 \0\b[index\0\b]
3489 * Menu:
3490
3491 * %:                                     Encode Parameters.    (line  6)
3492 * appearance modes:                      Standout.             (line  6)
3493 * bell:                                  Bell.                 (line  6)
3494 * clearing the screen:                   Clearing.             (line  6)
3495 * command character:                     Basic.                (line 65)
3496 * cursor motion:                         Cursor Motion.        (line  6)
3497 * delete character:                      Insdel Char.          (line  6)
3498 * delete line:                           Insdel Line.          (line  6)
3499 * delete mode:                           Insdel Char.          (line 40)
3500 * description format:                    Format.               (line  6)
3501 * erasing:                               Clearing.             (line  6)
3502 * generic terminal type:                 Basic.                (line 23)
3503 * home position:                         Cursor Motion.        (line 45)
3504 * inheritance:                           Inheriting.           (line  6)
3505 * initialization:                        Initialization.       (line  6)
3506 * insert character:                      Insdel Char.          (line  6)
3507 * insert line:                           Insdel Line.          (line  6)
3508 * insert mode:                           Insdel Char.          (line 24)
3509 * line speed:                            Output Padding.       (line  6)
3510 * magic cookie:                          Standout.             (line  6)
3511 * meta key:                              Meta Key.             (line  6)
3512 * names of terminal types:               Naming.               (line  6)
3513 * overstrike:                            Basic.                (line 11)
3514 * padding <1>:                           Pad Specs.            (line  6)
3515 * padding:                               Padding.              (line  6)
3516 * parameters:                            Parameters.           (line  6)
3517 * printer:                               Printer.              (line  6)
3518 * repeat output:                         Basic.                (line 42)
3519 * reset:                                 Initialization.       (line  6)
3520 * screen size <1>:                       Screen Size.          (line  6)
3521 * screen size:                           Naming.               (line 32)
3522 * scrolling:                             Scrolling.            (line  6)
3523 * standout:                              Standout.             (line  6)
3524 * status line:                           Status Line.          (line  6)
3525 * Superbee:                              Basic.                (line 78)
3526 * tab stops:                             Initialization.       (line  6)
3527 * termcap:                               Introduction.         (line  6)
3528 * terminal flags (kernel):               Initialize.           (line  6)
3529 * underlining:                           Underlining.          (line  6)
3530 * visibility:                            Cursor Visibility.    (line  6)
3531 * visible bell:                          Bell.                 (line  6)
3532 * window:                                Windows.              (line  6)
3533 * wrapping <1>:                          Wrapping.             (line  6)
3534 * wrapping:                              Naming.               (line 20)
3535
3536
3537 \1f
3538 Tag Table:
3539 Node: Top\7f959
3540 Node: Introduction\7f1604
3541 Node: Library\7f3328
3542 Node: Preparation\7f4346
3543 Node: Find\7f5550
3544 Node: Interrogate\7f9087
3545 Node: Initialize\7f14369
3546 Node: Padding\7f16012
3547 Node: Why Pad\7f16678
3548 Node: Describe Padding\7f18331
3549 Node: Output Padding\7f19815
3550 Node: Parameters\7f23432
3551 Node: Encode Parameters\7f25095
3552 Node: Using Parameters\7f31209
3553 Node: tparam\7f31807
3554 Node: tgoto\7f33880
3555 Node: Data Base\7f36448
3556 Node: Format\7f37326
3557 Node: Capability Format\7f39423
3558 Node: Naming\7f42478
3559 Node: Inheriting\7f47050
3560 Node: Capabilities\7f49281
3561 Node: Basic\7f52125
3562 Node: Screen Size\7f55974
3563 Node: Cursor Motion\7f57719
3564 Node: Wrapping\7f67374
3565 Node: Scrolling\7f70203
3566 Node: Windows\7f75228
3567 Node: Clearing\7f75967
3568 Node: Insdel Line\7f77734
3569 Node: Insdel Char\7f82645
3570 Node: Standout\7f92634
3571 Node: Underlining\7f101698
3572 Node: Cursor Visibility\7f104124
3573 Node: Bell\7f104879
3574 Node: Keypad\7f105435
3575 Node: Meta Key\7f110163
3576 Node: Initialization\7f111124
3577 Node: Pad Specs\7f113498
3578 Node: Status Line\7f115558
3579 Node: Half-Line\7f117449
3580 Node: Printer\7f118258
3581 Node: Summary\7f119944
3582 Node: Var Index\7f130150
3583 Node: Cap Index\7f131116
3584 Node: Index\7f140964
3585 \1f
3586 End Tag Table