summaryrefslogtreecommitdiff
path: root/libexec/getty/gettytab.5
blob: 49717e770dbb52d45effb8d4eefc36fe169003f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
.\"	$OpenBSD: gettytab.5,v 1.16 2003/06/02 19:38:24 millert Exp $
.\" Copyright (c) 1983, 1991, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     from: @(#)gettytab.5	8.4 (Berkeley) 4/19/94
.\"
.Dd April 19, 1994
.Dt GETTYTAB 5
.Os
.Sh NAME
.Nm gettytab
.Nd terminal configuration database
.Sh SYNOPSIS
.Nm gettytab
.Sh DESCRIPTION
The
.Nm
file
is a simplified version of the
.Xr termcap 5
database
used to describe terminal lines.
The initial terminal login process
.Xr getty 8
accesses the
.Nm
file each time it starts, allowing simpler
reconfiguration of terminal characteristics.
Each entry in the database
is used to describe one class of terminals.
.Pp
There is a default terminal class,
.Em default ,
that is used to set global defaults for all other classes.
(That is, the
.Em default
entry is read, then the entry for the class required
is used to override particular settings.)
.Sh CAPABILITIES
Refer to
.Xr termcap 5
for a description of the file layout.
The
.Em default
column below lists defaults obtained if there is
no entry in the table obtained, nor one in the special
.Em default
table.
.Bl -column indent indent indent
.It Sy Name	Type	Default	Description
.It "ap	bool	false	Terminal uses any parity."
.It "bk	str	0377	Alternative end-of-line character (input break)."
.It "c0	num	unused	TTY control flags to write messages."
.It "c1	num	unused	TTY control flags to read login name."
.It "c2	num	unused	TTY control flags to leave terminal as."
.It "ce	bool	false	Use CRT erase algorithm."
.It "ck	bool	false	Use CRT kill algorithm."
.It "cl	str" Ta Dv NULL Ta
.No "Screen clear sequence."
.It "co	bool	false	Console; add"
.Ql \en
after login prompt.
.It "ds	str" Ta So Li ^Y Sc Ta
.No "Delayed suspend character."
.It "dx	bool	false	Set"
.Dv DECCTLQ .
.It "ec	bool	false	Leave echo"
.Tn OFF .
.It "ep	bool	false	Terminal uses even parity."
.It "er	str" Ta So Li ^? Sc Ta
.No "Erase character."
.It "et	str" Ta So Li ^D Sc Ta
.No "End of text"
.Pq Dv EOF
character.
.It "ev	str" Ta Dv NULL Ta
.No "Initial environment."
.It "f0	num	unused	TTY mode flags to write messages."
.It "f1	num	unused	TTY mode flags to read login name."
.It "f2	num	unused	TTY mode flags to leave terminal as."
.It "fl	str" Ta So Li ^O Sc Ta
.No "Output flush character."
.It "hc	bool	false	Do"
.Em not
hangup line on last close.
.It "he	str" Ta Dv NULL Ta
.No "Hostname editing string."
.It "hn	str	hostname	Hostname."
.It "ht	bool	false	Terminal has real tabs."
.It "i0	num	unused	TTY input flags to write messages."
.It "i1	num	unused	TTY input flags to read login name."
.It "i2	num	unused	TTY input flags to leave terminal as."
.It "ig	bool	false	Ignore garbage characters in login name."
.It "im	str" Ta Dv NULL Ta
.No "Initial (banner) message."
.It "in	str" Ta So Li ^C Sc Ta
.No "Interrupt character."
.It "is	num	unused	Input speed."
.It "kl	str" Ta So Li ^U Sc Ta
.No "Kill character."
.It "l0	num	unused	TTY local flags to write messages."
.It "l1	num	unused	TTY local flags to read login name."
.It "l2	num	unused	TTY local flags to leave terminal as."
.It "lc	bool	false	Terminal has lower case."
.It "lm	str	login:	Login prompt."
.It "ln	str" Ta So Li ^V Sc Ta
.No "``Literal next'' character."
.It "lo	str" Ta Pa /usr/bin/login Ta
.No "Program to execute when name obtained."
.It "mb	bool	false	Do flow control based on carrier."
.It "nl	bool	false	Terminal has (or might have) a newline character."
.It "np	bool	false	Terminal uses no parity (i.e., 8-bit characters)."
.It "nx	str	default	Next table (for auto speed selection)."
.It "o0	num	unused	TTY output flags to write messages."
.It "o1	num	unused	TTY output flags to read login name."
.It "o2	num	unused	TTY output flags to leave terminal as."
.It "op	bool	false	Terminal uses odd parity."
.It "os	num	unused	Output speed."
.It "pc	str" Ta So Li \e0 Sc Ta
.No "Pad character."
.It "pe	bool	false	Use printer (hard copy) erase algorithm."
.It "pf	num	0	Delay"
between first prompt and following flush (seconds).
.It "pp	str	unused	PPP authentication program."
.It "ps	bool	false	Line connected to a"
.Tn MICOM
port selector.
.It "qu	str" Ta So Li \&^\e Sc Ta
.No "Quit character."
.It "rp	str" Ta So Li ^R Sc Ta
.No "Line retype character."
.It "rw	bool	false	Do"
.Em not
use raw for input, use cbreak.
.It "sp	num	unused	Line speed (input and output)."
.It "su	str" Ta So Li ^Z Sc Ta
.No "Suspend character."
.It "tc	str	none	Table continuation."
.It "to	num	0	Timeout (seconds)."
.It "tt	str" Ta Dv NULL Ta
.No "Terminal type (for environment)."
.It "ub	bool	false	Do unbuffered output (of prompts etc)."
.It "we	str" Ta So Li ^W Sc Ta
.No "Word erase character."
.It "xc	bool	false	Do"
.Em not
echo control characters as
.Ql ^X .
.It "xf	str" Ta So Li ^S Sc Ta Dv XOFF
(stop output) character.
.It "xn	str" Ta So Li ^Q Sc Ta Dv XON
(start output) character.
.El
.Pp
The following capabilities are no longer supported by
.Xr getty 8 :
.Bl -column indent indent indent
.It "bd	num	0	Backspace delay."
.It "cb	bool	false	Use CRT backspace mode."
.It "cd	num	0	Carriage-return delay."
.It "fd	num	0	Form-feed (vertical motion) delay."
.It "nd	num	0	Newline (line-feed) delay."
.It "uc	bool	false	Terminal is known upper case only."
.El
.Pp
If no line speed is specified, speed will not be altered
from that which prevails when
.Xr getty 8
is entered.
Specifying an input or output speed will override
line speed for stated direction only.
.Pp
Terminal modes to be used for the output of the message and
for input of the login name,
and to leave the terminal set as upon completion,
are derived from the boolean flags specified.
If the derivation should prove inadequate,
any (or all) of these three may be overridden
with one of the
.Em \&c0 ,
.Em \&c1 ,
.Em \&c2 ,
.Em \&i0 ,
.Em \&i1 ,
.Em \&i2 ,
.Em \&l0 ,
.Em \&l1 ,
.Em \&l2 ,
.Em \&o0 ,
.Em \&o1 ,
or
.Em \&o2
numeric specifications, which can be used to specify
(usually in octal, with a leading
.Ql 0 )
the exact values of the flags.
These flags correspond to the termios
.Em c_cflag ,
.Em c_iflag ,
.Em c_lflag ,
and
.Em c_oflag
fields, respectively.
Each of these sets must be completely specified to be effective.
The
.Em \&f0 ,
.Em \&f1 ,
and
.Em \&f2
are excepted for backwards compatibility with a previous incarnation of
the TTY sub-system.
In these flags the bottom 16 bits of the (32 bits) value contain the sgttyb
.Em sg_flags
field, while the top 16 bits represent the local mode word.
.Pp
Should
.Xr getty 8
receive a null character
(presumed to indicate a line break)
it will restart using the table indicated by the
.Em nx
entry.
If there is none, it will re-use its original table.
.Pp
Delays are specified in milliseconds;
the nearest possible delay available in the TTY driver will be used.
Should greater certainty be desired, delays
with values 0, 1, 2, and 3 are interpreted as
choosing that particular delay algorithm from the driver.
.Pp
The
.Em \&cl
screen clear string may be preceded by a (decimal) number
of milliseconds of delay required (a la
.Xr termcap 5 ) .
This delay is simulated by repeated use of the pad character
.Em \&pc .
.Pp
The initial message and login message
.Po
.Em \&im
and
.Em \&lm
.Pc
may include any of the following character sequences, which expand to
information about the environment in which
.Xr getty 8
is running:
.Pp
.Bl -tag -width \&%xxx
.It \&%d
The current date.
.It \&%h
The hostname of the machine, which is normally obtained from the
system using
.Xr gethostname 3 ,
but may also be overridden by the
.Em \&hn
table entry.
In either case it may be edited with the
.Em \&he
string.
A
.Ql @
in the
.Em \&he
string causes one character from the real hostname to
be copied to the final hostname.
A
.Ql #
in the
.Em \&he
string causes the next character of the real hostname
to be skipped.
Each character that
is neither
.Ql @
nor
.Ql #
is copied into the final hostname.
Surplus
.Ql @
and
.Ql #
characters are ignored.
.It \&%t
The TTY name.
.It "\&%m, \&%r, \&%s, \&%v"
The type of machine, release of the operating system, name of the
operating system, and version of the kernel, respectively, as
returned by
.Xr uname 3 .
.It \&%%
A
.Ql %
character.
.El
.Pp
When
.Xr getty 8
executes the login process given in the
.Em \&lo
string (usually
.Pa /usr/bin/login ) ,
it will have set
the environment to include the terminal type, as indicated
by the
.Em \&tt
string (if it exists).
The
.Em \&ev
string can be used to enter additional data into the environment.
It is a list of comma-separated strings, each of which
will presumably be of the form
.Em name=value .
.Pp
If a non-zero timeout is specified with
.Em \&to ,
then
.Xr getty 8
will exit within the indicated number of seconds, either having
received a login name and passed control to
.Xr login 1 ,
or having received an alarm signal and exited.
This may be useful to hangup dial in lines.
.Pp
Output from
.Xr getty 8
is even parity unless
.Em \&op
or
.Em \&np
is specified.
The
.Em \&op
string
may be specified with
.Em \&ap
to allow any parity on input, but generate odd parity output.
Note: this only applies while
.Xr getty 8
is being run;
terminal driver limitations prevent a more complete implementation.
.Xr getty 8
does not check parity of input characters in
.Dv RAW
mode.
.Pp
If a
.Em \&pp
string is specified and a PPP link bring-up sequence is recognized,
.Xr getty 8
will invoke the program referenced by the
.Em \&pp
option.
This can be used to handle incoming PPP calls.
.Sh SEE ALSO
.Xr login 1 ,
.Xr gethostname 3 ,
.Xr uname 3 ,
.Xr termcap 5 ,
.Xr getty 8
.Sh HISTORY
The
.Nm
file format appeared in
.Bx 4.2 .
.Sh BUGS
The special characters (erase, kill, etc.) are reset to system defaults by
.Xr login 1 .
In
.Em all
cases,
.Ql #
or
.Ql ^H
typed in a login name will be treated as an erase character,
and
.Ql @
will be treated as a kill character.
.Pp
The delay stuff is a real crock.
Apart from its general lack of flexibility, some
of the delay algorithms are not implemented.
The terminal driver should support sane delay settings.
.Pp
The
.Em \&he
capability is stupid.
.Pp
The
.Xr termcap 5
format is horrid; something more rational should have been chosen.