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