GETTYTAB(5)
GETTYTAB(5) Β· File Formats Manual β okay bestie, weβre about to read the terminal configuration data base page together, and itβs honestly giving vintage Unix main-character energy.
πΈ NAME πΈ
gettytab β terminal configuration data base.
π SYNOPSIS π
gettytab
β¨ DESCRIPTION β¨
The gettytab file is a simplified version of the termcap(5) data base used to describe terminal lines. The initial terminal login process getty(8) reads the gettytab file every time it starts, which makes reconfiguring terminal characteristics simpler. Each entry in the data base describes one class of terminals.
Thereβs a default terminal class, default, that sets global defaults for all the other classes. (Like, the default entry gets read first, then the entry for the class you actually need is used to override particular settings. Slay.)
π CAPABILITIES π
Peep termcap(5) for a description of the file layout. The defaults listed below are what you get when thereβs no entry in the table you looked up and no entry in the special default table either. Hereβs the full roster: name Β· type Β· default Β· what it does.
acβ str Β· defaultunusedβ expect-send chat script for modem answer.alβ str Β· defaultunusedβ user to auto-login instead of prompting.apβ bool Β· defaultfalseβ terminal uses any parity.bkβ str Β· default0377β alternate end of line character (input break).c0β num Β· defaultunusedβ tty control flags to write messages.c1β num Β· defaultunusedβ tty control flags to read login name.c2β num Β· defaultunusedβ tty control flags to leave terminal as.ceβ bool Β· defaultfalseβ use crt erase algorithm.ckβ bool Β· defaultfalseβ use crt kill algorithm.clβ str Β· defaultNULL.coβ bool Β· defaultfalseβ console β add\nafter login prompt.ctβ num Β· default10β chat timeout foracandicscripts.dcβ num Β· default0β chat debug bitmask.deβ num Β· default0β delay secs and flush input before writing first prompt.dfβ str Β· default%+β thestrftime(3)format used for%din the banner message.dsβ str Β· defaultβ^Yββ delayed suspend character.dxβ bool Β· defaultfalseβ set DECCTLQ.ecβ bool Β· defaultfalseβ leave echo OFF.epβ bool Β· defaultfalseβ terminal uses even parity.erβ str Β· defaultβ^?ββ erase character.etβ str Β· defaultβ^Dββ end of text (EOF) character.evβ str Β· defaultNULL.flβ str Β· defaultβ^Oββ output flush character.hcβ bool Β· defaultfalseβ do NOT hangup line on last close.heβ str Β· defaultNULL.hnβ str Β· defaulthostnameβ hostname.htβ bool Β· defaultfalseβ terminal has real tabs.hwβ bool Β· defaultfalseβ do cts/rts hardware flow control.i0β num Β· defaultunusedβ tty input flags to write messages.i1β num Β· defaultunusedβ tty input flags to read login name.i2β num Β· defaultunusedβ tty input flags to leave terminal as.icβ str Β· defaultunusedβ expect-send chat script for modem initialization.ifβ str Β· defaultunusedβ display named file before prompt, like/etc/issue.igβ bool Β· defaultfalseβ ignore garbage characters in login name.imβ str Β· defaultNULL.iMβ str Β· defaultNULL.inβ str Β· defaultβ^Cββ interrupt character.isβ num Β· defaultunusedβ input speed.klβ str Β· defaultβ^Uββ kill character.l0β num Β· defaultunusedβ tty local flags to write messages.l1β num Β· defaultunusedβ tty local flags to read login name.l2β num Β· defaultunusedβ tty local flags to leave terminal as.lmβ str Β· defaultlogin:β login prompt.lnβ str Β· defaultβ^Vββ βliteral nextβ character.loβ str Β· default/usr/bin/login.mbβ bool Β· defaultfalseβ do flow control based on carrier.ncβ bool Β· defaultfalseβ terminal does not supply carrier (set clocal).nlβ bool Β· defaultfalseβ terminal has (or might have) a newline character.npβ bool Β· defaultfalseβ terminal uses no parity (i.e., 8-bit characters).nxβ str Β· defaultdefaultβ next table (for auto speed selection).o0β num Β· defaultunusedβ tty output flags to write messages.o1β num Β· defaultunusedβ tty output flags to read login name.o2β num Β· defaultunusedβ tty output flags to leave terminal as.opβ bool Β· defaultfalseβ terminal uses odd parity.osβ num Β· defaultunusedβ output speed.pcβ str Β· defaultβ\0ββ pad character.peβ bool Β· defaultfalseβ use printer (hard copy) erase algorithm.pfβ num Β· default0β delay between first prompt and following flush (seconds).plβ bool Β· defaultfalseβ start PPP login program unconditionally ifppis specified.ppβ str Β· defaultunusedβ PPP login program.psβ bool Β· defaultfalseβ line connected to a MICOM port selector.quβ str Β· defaultβ^\ββ quit character.rpβ str Β· defaultβ^Rββ line retype character.rtβ num Β· defaultunusedβ ring timeout when usingac.rwβ bool Β· defaultfalseβ do NOT use raw for input, use cbreak.spβ num Β· defaultunusedβ line speed (input and output).suβ str Β· defaultβ^Zββ suspend character.tcβ str Β· defaultnoneβ table continuation.toβ num Β· default0β timeout (seconds).ttβ str Β· defaultNULL.ubβ bool Β· defaultfalseβ do unbuffered output (of prompts etc).weβ str Β· defaultβ^Wββ word erase character.xcβ bool Β· defaultfalseβ do NOT echo control chars as^X.xfβ str Β· defaultβ^Sββ XOFF (stop output) character.xnβ str Β· defaultβ^Qββ XON (start output) character.Loβ str Β· defaultCβ the locale name used for%din the banner message.
π the ones getty(8) no longer supports π
These capabilities are no longer supported by getty(8) β theyβre still listed here, but bestie, do not expect them to be doing anything for you:
bdβ num Β· default0β backspace delay.cbβ bool Β· defaultfalseβ use crt backspace mode.cdβ num Β· default0β carriage-return delay.f0β num Β· defaultunusedβ tty mode flags to write messages.f1β num Β· defaultunusedβ tty mode flags to read login name.f2β num Β· defaultunusedβ tty mode flags to leave terminal as.fdβ num Β· default0β form-feed (vertical motion) delay.lcβ bool Β· defaultfalseβ terminal has lower case.ndβ num Β· default0β newline (line-feed) delay.ucβ bool Β· defaultfalseβ terminal is known upper case only.
If no line speed is specified, speed will not be altered from that which prevails when getty is entered. Specifying an input or output speed will override line speed for the stated direction only.
The terminal modes used for outputting the message, for reading the login name, and for leaving the terminal set when itβs done are derived from the boolean flags you specify. If that derivation proves inadequate, any (or all) of these three can be overridden with one of the c0, c1, c2, i0, i1, i2, l0, l1, l2, o0, o1, or o2 numeric specifications. Those let you specify (usually in octal, with a leading '0') the exact values of the flags. These flags correspond to the termios c_cflag, c_iflag, c_lflag, and c_oflag fields, respectively. Each of these sets must be completely specified to be effective.
Should getty(8) receive a null character (presumed to indicate a line break), it will restart using the table indicated by the nx entry. If there is none, it will re-use its original table.
Delays are specified in milliseconds, and the nearest possible delay available in the tty driver will be used. If greater certainty is desired, delays with values 0, 1, 2, and 3 are interpreted as choosing that particular delay algorithm from the driver.
The cl screen clear string may be preceded by a (decimal) number of milliseconds of delay required (a la termcap). This delay is simulated by repeated use of the pad character pc.
The initial message, login message, and initial file β im, lm, and if β may include any of the following character sequences, which expand to information about the environment in which getty(8) is running:
%dβ the current date and time formatted according to theLoanddfstrings.%hβ the hostname of the machine, normally obtained from the system usinggethostname(3), but also possibly overridden by thehntable entry. In either case it may be edited with thehePOSIX βextendedβ regular expression, which is matched against the hostname. If there are no parenthesized subexpressions in the pattern, the entire matched string is used as the final hostname; otherwise, the first matched subexpression is used instead. If the pattern does not match, the original hostname is not modified.%tβ the tty name.%m,%r,%s,%vβ the type of machine, release of the operating system, name of the operating system, and version of the kernel, respectively, as returned byuname(3).%%β a β%β character.
When getty execs the login process, given in the lo string (usually /usr/bin/login), it will have set the environment to include the terminal type, as indicated by the tt string (if it exists). The ev string can be used to enter additional data into the environment. It is a list of comma separated strings, each of which will presumably be of the form name=value.
If a non-zero timeout is specified, with to, then getty will exit within the indicated number of seconds, either having received a login name and passed control to login(1), or having received an alarm signal, and exited. This may be useful to hangup dial in lines.
Output from getty(8) is even parity unless op or np is specified. The op string may be specified with ap to allow any parity on input, but generate odd parity output. Note: this only applies while getty is being run β terminal driver limitations prevent a more complete implementation. getty(8) does not check parity of input characters in RAW mode. π«Ά
If a pp string is specified and a PPP link bring-up sequence is recognized, getty will invoke the program referenced by the pp option. This can be used to handle incoming PPP calls. If the pl option is true as well, getty(8) will skip the user name prompt and the PPP detection phase, and will invoke the program specified by pp instantly. β¨
Getty provides some basic intelligent modem handling by providing a chat script feature available via two capabilities:
icβ Chat script to initialize modem. πacβ Chat script to answer a call. π¦
A chat script is a set of expect/send string pairs. When a chat string starts, getty will wait for the first string, and if it finds it, will send the second, and so on. Strings specified are separated by one or more tabs or spaces. Strings may contain standard ASCII characters and special 'escapes', which consist of a backslash character followed by one or more characters which are interpreted as follows:
\aβ bell character. π\bβ backspace.\nβ newline.\eβ escape.\fβ formfeed.\pβ half-second pause.\rβ carriage return.\S,\sβ space character.\tβ tab.\xNNβ hexadecimal byte value.\0NNNβ octal byte value.
Note that the \p sequence is only valid for send strings and causes a half-second pause between sending the previous and next characters. Hexadecimal values are, at most, 2 hex digits long, and octal values are a maximum of 3 octal digits. β³
The ic chat sequence is used to initialize a modem or similar device. A typical example of an init chat script for a modem with a hayes compatible command set might look like this:
:ic="" ATE0Q0V1\r OK\r ATS0=0\r OK\r:
This script waits for nothing (which always succeeds), sends a sequence to ensure that the modem is in the correct mode (suppress command echo, send responses in verbose mode), and then disables auto-answer. It waits for an "OK" response before it terminates. The init sequence is used to check modem responses to ensure that the modem is functioning correctly. If the init script fails to complete, getty considers this to be fatal, and results in an error logged via syslogd(8), and exiting. π
Similarly, an answer chat script is used to manually answer the phone in response to (usually) a "RING". When run with an answer script, getty opens the port in non-blocking mode, clears any extraneous input and waits for data on the port. As soon as any data is available, the answer chat script is started and scanned for a string, and responds according to the answer chat script. With a hayes compatible modem, this would normally look something like:
:ac=RING\r ATA\r CONNECT:
This causes the modem to answer the call via the "ATA" command, then scans input for a "CONNECT" string. If this is received before a ct timeout, then a normal login sequence commences. π₯
The ct capability specifies a timeout for all send and expect strings. This timeout is set individually for each expect wait and send string and must be at least as long as the time it takes for a connection to be established between a remote and local modem (usually around 10 seconds). β±οΈ
In most situations, you will want to flush any additional input after the connection has been detected, and the de capability may be used to do that, as well as delay for a short time after the connection has been established during which all of the connection data has been sent by the modem. π
π SEE ALSO π
Your reference besties: login(1), gethostname(3), uname(3), termcap(5), getty(8). π
π¦ HISTORY π¦
The gettytab file format appeared in 4.2BSD. β
π BUGS π
The special characters (erase, kill, etc.) are reset to system defaults by login(1). In all cases, # or ^H typed in a login name will be treated as an erase character, and @ will be treated as a kill character. π
The delay stuff is a real crock. Apart form its general lack of flexibility, some of the delay algorithms are not implemented. The terminal driver should support sane delay settings. ππ
The termcap(5) format is horrid, something more rational should have been chosen. π
xoxo, bestie π β this one's from Debian, dated September 29, 2022, and it's the GETTYTAB(5) page. π
π¦ where this page comes from
- nixpkgs unstable: system_cmds 1042.100.6.0.1
- Copyright (c) 1983, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms