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