xref: /openbsd/libexec/getty/gettytab.5 (revision 91f110e0)
1.\"	$OpenBSD: gettytab.5,v 1.22 2013/12/10 20:56:59 naddy 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 $Mdocdate: December 10 2013 $
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 "Name" "Type" "Default" "Description"
74.It Sy Name Ta Sy Type Ta Sy Default Ta Sy Description
75.It ap Ta bool Ta false Ta "Terminal uses any parity."
76.It bk Ta str Ta 0377 Ta "Alternative end-of-line character (input break)."
77.It c0 Ta num Ta unused Ta "TTY control flags to write messages."
78.It c1 Ta num Ta unused Ta "TTY control flags to read login name."
79.It c2 Ta num Ta unused Ta "TTY control flags to leave terminal as."
80.It ce Ta bool Ta false Ta "Use CRT erase algorithm."
81.It ck Ta bool Ta false Ta "Use CRT kill algorithm."
82.It cl Ta str" Ta Dv NULL Ta "Screen clear sequence."
83.It co Ta bool Ta false Ta "Console; add"
84.Ql \en
85after login prompt.
86.It ds Ta str Ta So Li ^Y Sc Ta "Delayed suspend character."
87.It dx Ta bool Ta false Ta "Set"
88.Dv DECCTLQ .
89.It ec Ta bool Ta false Ta "Leave echo OFF."
90.It ep Ta bool Ta false Ta "Terminal uses even parity."
91.It er Ta str Ta So Li ^? Sc Ta "Erase character."
92.It et Ta str Ta So Li ^D Sc Ta "End of text"
93.Pq Dv EOF
94character.
95.It ev Ta str Ta Dv NULL Ta "Initial environment."
96.It fl Ta str Ta So Li ^O Sc Ta "Output flush character."
97.It hc Ta bool Ta false Ta "\&Do"
98.Em not
99hangup line on last close.
100.It he Ta str Ta Dv NULL Ta "Hostname editing string."
101.It hn Ta str Ta hostname Ta "Hostname."
102.It ht Ta bool Ta false Ta "Terminal has real tabs."
103.It i0 Ta num Ta unused Ta "TTY input flags to write messages."
104.It i1 Ta num Ta unused Ta "TTY input flags to read login name."
105.It i2 Ta num Ta unused Ta "TTY input flags to leave terminal as."
106.It ig Ta bool Ta false Ta "Ignore garbage characters in login name."
107.It im Ta str Ta Dv NULL Ta "Initial (banner) message."
108.It in Ta str Ta So Li ^C Sc Ta "Interrupt character."
109.It is Ta num Ta unused Ta "Input speed."
110.It kl Ta str Ta So Li ^U Sc Ta "Kill character."
111.It l0 Ta num Ta unused Ta "TTY local flags to write messages."
112.It l1 Ta num Ta unused Ta "TTY local flags to read login name."
113.It l2 Ta num Ta unused Ta "TTY local flags to leave terminal as."
114.It lc Ta bool Ta false Ta "Terminal has lower case."
115.It lm Ta str Ta login: Ta "Login prompt."
116.It ln Ta str Ta So Li ^V Sc Ta "``Literal next'' character."
117.It lo Ta str Ta Pa /usr/bin/login Ta "Program to execute when name obtained."
118.It mb Ta bool Ta false Ta "\&Do flow control based on carrier."
119.It nl Ta bool Ta false Ta "Terminal has (or might have) a newline character."
120.It np Ta bool Ta false Ta "Terminal uses no parity (i.e., 8-bit characters)."
121.It nx Ta str Ta default Ta "Next table (for auto speed selection)."
122.It o0 Ta num Ta unused Ta "TTY output flags to write messages."
123.It o1 Ta num Ta unused Ta "TTY output flags to read login name."
124.It o2 Ta num Ta unused Ta "TTY output flags to leave terminal as."
125.It op Ta bool Ta false Ta "Terminal uses odd parity."
126.It os Ta num Ta unused Ta "Output speed."
127.It pc Ta str Ta So Li \e0 Sc Ta "Pad character."
128.It pe Ta bool Ta false Ta "Use printer (hard copy) erase algorithm."
129.It pf Ta num Ta 0 Ta "Delay"
130between first prompt and following flush (seconds).
131.It pp Ta str Ta unused Ta "PPP authentication program."
132.It ps Ta bool Ta false Ta "Line connected to a MICOM port selector."
133.It qu Ta str Ta So Li \&^\e Sc Ta "Quit character."
134.It rp Ta str Ta So Li ^R Sc Ta "Line retype character."
135.It rw Ta bool Ta false Ta "\&Do"
136.Em not
137use raw for input, use cbreak.
138.It sp Ta num Ta unused Ta "Line speed (input and output)."
139.It su Ta str Ta So Li ^Z Sc Ta "Suspend character."
140.It tc Ta str Ta none Ta "Table continuation."
141.It to Ta num Ta 0 Ta "Timeout (seconds)."
142.It tt Ta str Ta Dv NULL Ta "Terminal type (for environment)."
143.It ub Ta bool Ta false Ta "\&Do unbuffered output (of prompts etc)."
144.It we Ta str Ta So Li ^W Sc Ta "Word erase character."
145.It xc Ta bool Ta false Ta "\&Do"
146.Em not
147echo control characters as
148.Ql ^X .
149.It xf Ta str Ta So Li ^S Sc Ta Dv XOFF
150(stop output) character.
151.It xn Ta str Ta So Li ^Q Sc Ta Dv XON
152(start output) character.
153.El
154.Pp
155The following capabilities are no longer supported by
156.Xr getty 8 :
157.Bl -column "bd" "bool" "flase" "description"
158.It bd Ta num Ta 0 Ta "Backspace delay."
159.It cb Ta bool Ta false Ta "Use CRT backspace mode."
160.It cd Ta num Ta 0 Ta "Carriage-return delay."
161.It f0 Ta num Ta unused Ta "TTY mode flags to write messages."
162.It f1 Ta num Ta unused Ta "TTY mode flags to read login name."
163.It f2 Ta num Ta unused Ta "TTY mode flags to leave terminal as."
164.It fd Ta num Ta 0 Ta "Form-feed (vertical motion) delay."
165.It nd Ta num Ta 0 Ta "Newline (line-feed) delay."
166.It uc Ta bool Ta false Ta "Terminal is known upper case only."
167.El
168.Pp
169If no line speed is specified, speed will not be altered
170from that which prevails when
171.Xr getty 8
172is entered.
173Specifying an input or output speed will override
174line speed for stated direction only.
175.Pp
176Terminal modes to be used for the output of the message and
177for input of the login name,
178and to leave the terminal set as upon completion,
179are derived from the boolean flags specified.
180If the derivation should prove inadequate,
181any (or all) of these three may be overridden
182with one of the
183.Em \&c0 ,
184.Em \&c1 ,
185.Em \&c2 ,
186.Em \&i0 ,
187.Em \&i1 ,
188.Em \&i2 ,
189.Em \&l0 ,
190.Em \&l1 ,
191.Em \&l2 ,
192.Em \&o0 ,
193.Em \&o1 ,
194or
195.Em \&o2
196numeric specifications, which can be used to specify
197(usually in octal, with a leading
198.Ql 0 )
199the exact values of the flags.
200These flags correspond to the termios
201.Em c_cflag ,
202.Em c_iflag ,
203.Em c_lflag ,
204and
205.Em c_oflag
206fields, respectively.
207Each of these sets must be completely specified to be effective.
208.Pp
209Should
210.Xr getty 8
211receive a null character
212(presumed to indicate a line break)
213it will restart using the table indicated by the
214.Em nx
215entry.
216If there is none, it will re-use its original table.
217.Pp
218Delays are specified in milliseconds;
219the nearest possible delay available in the TTY driver will be used.
220Should greater certainty be desired, delays
221with values 0, 1, 2, and 3 are interpreted as
222choosing that particular delay algorithm from the driver.
223.Pp
224The
225.Em \&cl
226screen clear string may be preceded by a (decimal) number
227of milliseconds of delay required (a la
228.Xr termcap 5 ) .
229This delay is simulated by repeated use of the pad character
230.Em \&pc .
231.Pp
232The initial message and login message
233.Po
234.Em \&im
235and
236.Em \&lm
237.Pc
238may include any of the following character sequences, which expand to
239information about the environment in which
240.Xr getty 8
241is running:
242.Bl -tag -width \&%xxx
243.It \&%d
244The current date.
245.It \&%h
246The hostname of the machine, which is normally obtained from the
247system using
248.Xr gethostname 3 ,
249but may also be overridden by the
250.Em \&hn
251table entry.
252In either case it may be edited with the
253.Em \&he
254string.
255A
256.Ql @
257in the
258.Em \&he
259string causes one character from the real hostname to
260be copied to the final hostname.
261A
262.Ql #
263in the
264.Em \&he
265string causes the next character of the real hostname
266to be skipped.
267Each character that
268is neither
269.Ql @
270nor
271.Ql #
272is copied into the final hostname.
273Surplus
274.Ql @
275and
276.Ql #
277characters are ignored.
278.It \&%t
279The TTY name.
280.It "\&%m, \&%r, \&%s, \&%v"
281The type of machine, release of the operating system, name of the
282operating system, and version of the kernel, respectively, as
283returned by
284.Xr uname 3 .
285.It \&%%
286A
287.Ql %
288character.
289.El
290.Pp
291When
292.Xr getty 8
293executes the login process given in the
294.Em \&lo
295string (usually
296.Pa /usr/bin/login ) ,
297it will have set
298the environment to include the terminal type, as indicated
299by the
300.Em \&tt
301string (if it exists).
302The
303.Em \&ev
304string can be used to enter additional data into the environment.
305It is a list of comma-separated strings, each of which
306will presumably be of the form
307.Em name=value .
308.Pp
309If a non-zero timeout is specified with
310.Em \&to ,
311then
312.Xr getty 8
313will exit within the indicated number of seconds, either having
314received a login name and passed control to
315.Xr login 1 ,
316or having received an alarm signal and exited.
317This may be useful to hangup dial in lines.
318.Pp
319Output from
320.Xr getty 8
321is even parity unless
322.Em \&op
323or
324.Em \&np
325is specified.
326The
327.Em \&op
328string
329may be specified with
330.Em \&ap
331to allow any parity on input, but generate odd parity output.
332Note: this only applies while
333.Xr getty 8
334is being run;
335terminal driver limitations prevent a more complete implementation.
336.Xr getty 8
337does not check parity of input characters in
338.Dv RAW
339mode.
340.Pp
341If a
342.Em \&pp
343string is specified and a PPP link bring-up sequence is recognized,
344.Xr getty 8
345will invoke the program referenced by the
346.Em \&pp
347option.
348This can be used to handle incoming PPP calls.
349.Sh SEE ALSO
350.Xr login 1 ,
351.Xr gethostname 3 ,
352.Xr uname 3 ,
353.Xr termcap 5 ,
354.Xr getty 8
355.Sh HISTORY
356The
357.Nm
358file format appeared in
359.Bx 4.2 .
360.Sh BUGS
361The special characters (erase, kill, etc.) are reset to system defaults by
362.Xr login 1 .
363In
364.Em all
365cases,
366.Ql #
367or
368.Ql ^H
369typed in a login name will be treated as an erase character,
370and
371.Ql @
372will be treated as a kill character.
373.Pp
374The delay stuff is a real crock.
375Apart from its general lack of flexibility, some
376of the delay algorithms are not implemented.
377The terminal driver should support sane delay settings.
378.Pp
379The
380.Em \&he
381capability is stupid.
382.Pp
383The
384.Xr termcap 5
385format is horrid; something more rational should have been chosen.
386