annotate man/termcap.texi @ 5090:0ca81354c4c7

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