annotate man/termcap.texi @ 337:fbbf69b4e8a7 r21-0-66

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