Penguin
Annotated edit history of reset(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 tset
2 !!!tset
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 SETTING THE ENVIRONMENT
7 TERMINAL TYPE MAPPING
8 HISTORY
9 COMPATIBILITY
10 ENVIRONMENT
11 FILES
12 SEE ALSO
13 ----
14 !!NAME
15
16
17 __tset__, __reset__ - terminal initialization
18 !!SYNOPSIS
19
20
21 tset [[-IQVqrs] [[-] [[-e ''ch''] [[-i ''ch''] [[-k
22 ''ch''] [[-m ''mapping''] [[''terminal'']
23 reset [[-IQVqrs] [[-] [[-e ''ch''] [[-i ''ch''] [[-k
24 ''ch''] [[-m ''mapping'']
25 [[''terminal'']
26 !!DESCRIPTION
27
28
29 __Tset__ initializes terminals. __Tset__ first
30 determines the type of terminal that you are using. This
31 determination is done as follows, using the first terminal
32 type found.
33
34
35 1. The __terminal__ argument specified on the command
36 line.
37
38
39 2. The value of the __TERM__ environmental
40 variable.
41
42
43 3. (BSD systems only.) The terminal type associated with the
44 standard error output device in the ''/etc/ttys'' file.
45 (On Linux and System-V-like UNIXes, ''getty'' does this
46 job by setting __TERM__ according to the type passed to
47 it by ''/etc/inittab''.)
48
49
50 4. The default terminal type, ``unknown''.
51
52
53 If the terminal type was not specified on the command-line,
54 the -m option mappings are then applied (see below for more
55 information). Then, if the terminal type begins with a
56 question mark (``?''), the user is prompted for confirmation
57 of the terminal type. An empty response confirms the type,
58 or, another type can be entered to specify a new type. Once
59 the terminal type has been determined, the terminfo entry
60 for the terminal is retrieved. If no terminfo entry is found
61 for the type, the user is prompted for another terminal
62 type.
63
64
65 Once the terminfo entry is retrieved, the window size,
66 backspace, interrupt and line kill characters (among many
67 other things) are set and the terminal and tab
68 initialization strings are sent to the standard error
69 output. Finally, if the erase, interrupt and line kill
70 characters have changed, or are not set to their default
71 values, their values are displayed to the standard error
72 output.
73
74
75 When invoked as __reset__, __tset__ sets cooked and
76 echo modes, turns off cbreak and raw modes, turns on newline
77 translation and resets any unset special characters to their
78 default values before doing the terminal initialization
79 described above. This is useful after a program dies leaving
80 a terminal in an abnormal state. Note, you may have to
81 type
82
83
84 ____
85
86
87 (the line-feed character is normally control-J) to get the
88 terminal to work, as carriage-return may no longer work in
89 the abnormal state. Also, the terminal will often not echo
90 the command.
91
92
93 The options are as follows:
94
95
96 -q
97
98
99 The terminal type is displayed to the standard output, and
100 the terminal is not initialized in any way. The option `-'
101 by itself is equivalent but archaic.
102
103
104 -e
105
106
107 Set the erase character to ''ch''.
108
109
110 -I
111
112
113 Do not send the terminal or tab initialization strings to
114 the terminal.
115
116
117 -Q
118
119
120 Don't display any values for the erase, interrupt and line
121 kill characters.
122
123
124 __-V__
125
126
127 reports the version of ncurses which was used in this
128 program, and exits.
129
130
131 -i
132
133
134 Set the interrupt character to ''ch''.
135
136
137 -k
138
139
140 Set the line kill character to ''ch''.
141
142
143 -m
144
145
146 Specify a mapping from a port type to a terminal. See below
147 for more information.
148
149
150 -r
151
152
153 Print the terminal type to the standard error
154 output.
155
156
157 -s
158
159
160 Print the sequence of shell commands to initialize the
161 environment variable __TERM__ to the standard output. See
162 the section below on setting the environment for
163 details.
164
165
166 The arguments for the -e, -i, and -k options may either be
167 entered as actual characters or by using the `hat' notation,
168 i.e. control-h may be specified as ``^H'' or
169 ``^h''.
170 !!SETTING THE ENVIRONMENT
171
172
173 It is often desirable to enter the terminal type and
174 information about the terminal's capabilities into the
175 shell's environment. This is done using the -s
176 option.
177
178
179 When the -s option is specified, the commands to enter the
180 information into the shell's environment are written to the
181 standard output. If the __SHELL__ environmental variable
182 ends in ``csh'', the commands are for __csh__, otherwise,
183 they are for __sh__. Note, the __csh__ commands set
184 and unset the shell variable __noglob__, leaving it
185 unset. The following line in the __.login__ or
186 __.profile__ files will initialize the environment
187 correctly:
188
189
190 eval tset -s options ...
191 !!TERMINAL TYPE MAPPING
192
193
194 When the terminal is not hardwired into the system (or the
195 current system information is incorrect) the terminal type
196 derived from the ''/etc/ttys'' file or the __TERM__
197 environmental variable is often something generic like
198 __network__, __dialup__, or __unknown__. When
199 __tset__ is used in a startup script it is often
200 desirable to provide information about the type of terminal
201 used on such ports.
202
203
204 The purpose of the -m option is to map from some set of
205 conditions to a terminal type, that is, to tell __tset__
206 ``If I'm on this port at a particular speed, guess that I'm
207 on that kind of terminal''.
208
209
210 The argument to the -m option consists of an optional port
211 type, an optional operator, an optional baud rate
212 specification, an optional colon (``:'') character and a
213 terminal type. The port type is a string (delimited by
214 either the operator or the colon character). The operator
215 may be any combination of ``
216
217
218 If the terminal type is not specified on the command line,
219 the -m mappings are applied to the terminal type. If the
220 port type and baud rate match the mapping, the terminal type
221 specified in the mapping replaces the current type. If more
222 than one mapping is specified, the first applicable mapping
223 is used.
224
225
226 For example, consider the following mapping:
227 __dialup__. The port type is dialup , the
228 operator is
229 __dialup__, and the
230 baud rate is greater than 9600 baud, a terminal type of
231 __vt100__ will be used.
232
233
234 If no baud rate is specified, the terminal type will match
235 any baud rate. If no port type is specified, the terminal
236 type will match any port type. For example, __-m
237 dialup:vt100 -m :?xterm__ will cause any dialup port,
238 regardless of baud rate, to match the terminal type vt100,
239 and any non-dialup port type to match the terminal type
240 ?xterm. Note, because of the leading question mark, the user
241 will be queried on a default port as to whether they are
242 actually using an xterm terminal.
243
244
245 No whitespace characters are permitted in the -m option
246 argument. Also, to avoid problems with meta-characters, it
247 is suggested that the entire -m option argument be placed
248 within single quote characters, and that __csh__ users
249 insert a backslash character (``'') before any exclamation
250 marks (``!'').
251 !!HISTORY
252
253
254 The __tset__ command appeared in BSD 3.0. The
255 __ncurses__ implementation was lightly adapted from the
256 4.4BSD sources for a terminfo environment by Eric S. Raymond
257 __
258 !!COMPATIBILITY
259
260
261 The __tset__ utility has been provided for
262 backward-compatibility with BSD environments (under most
263 modern UNIXes, __/etc/inittab__ and getty(1) can
264 set __TERM__ appropriately for each dial-up line; this
265 obviates what was __tset__'s most important use). This
266 implementation behaves like 4.4BSD tset, with a few
267 exceptions specified here.
268
269
270 The -S option of BSD tset no longer works; it prints an
271 error message to stderr and dies. The -s option only sets
272 __TERM__, not __TERMCAP__. Both these changes are
273 because the __TERMCAP__ variable is no longer supported
274 under terminfo-based __ncurses__, which makes __tset
275 -S__ useless (we made it die noisily rather than silently
276 induce lossage).
277
278
279 There was an undocumented 4.4BSD feature that invoking tset
280 via a link named `TSET` (or via any other name beginning
281 with an upper-case letter) set the terminal to use
282 upper-case only. This feature has been omitted.
283
284
285 The -A, -E, -h, -u and -v options were deleted from the
286 __tset__ utility in 4.4BSD. None of them were documented
287 in 4.3BSD and all are of limited utility at best. The -a,
288 -d, and -p options are similarly not documented or useful,
289 but were retained as they appear to be in widespread use. It
290 is strongly recommended that any usage of these three
291 options be changed to use the -m option instead. The -n
292 option remains, but has no effect. The -adnp options are
293 therefore omitted from the usage summary above.
294
295
296 It is still permissible to specify the -e, -i, and -k
297 options without arguments, although it is strongly
298 recommended that such usage be fixed to explicitly specify
299 the character.
300
301
302 As of 4.4BSD, executing __tset__ as __reset__ no
303 longer implies the -Q option. Also, the interaction between
304 the - option and the ''terminal'' argument in some
305 historic implementations of __tset__ has been
306 removed.
307 !!ENVIRONMENT
308
309
310 The __tset__ command uses the __SHELL__ and
311 __TERM__ environment variables.
312 !!FILES
313
314
315 /etc/ttys
316
317
318 system port name to terminal type mapping database (BSD
319 versions only).
320
321
322 /usr/share/terminfo
323
324
325 terminal capability database
326 !!SEE ALSO
327
328
329 csh(1), sh(1), stty(1), tty(4), termcap(5), ttys(5),
330 environ(7)
331 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.