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