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