tail head cat sleep
QR code linking to this page

Manual Pages  — GETTYTAB

NAME

gettytab – terminal configuration data base

CONTENTS

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) accesses the gettytab file each time it starts, allowing simpler reconfiguration of terminal characteristics. Each entry in the data base is used to describe one class of terminals.

There is a default terminal class, default, that is used to set global defaults for all other classes. (That is, the default entry is read, then the entry for the class required is used to override particular settings.)

CAPABILITIES

Refer to termcap(5) for a description of the file layout. The default column below lists defaults obtained if there is no entry in the table obtained, nor one in the special default table.
Name Ta Type Ta Default Description

ac Ta str Ta unused
expect-send chat script for modem answer

al Ta str Ta unused
user to auto-login instead of prompting

ap Ta bool Ta false
terminal uses any parity

bk Ta str Ta 0377
alternate end of line character (input break)

c0 Ta num Ta unused
tty control flags to write messages

c1 Ta num Ta unused
tty control flags to read login name

c2 Ta num Ta unused
tty control flags to leave terminal as

ce Ta bool Ta false
use crt erase algorithm

ck Ta bool Ta false
use crt kill algorithm

cl
str NULL screen clear sequence

co Ta bool Ta false
console - add‘\n’ after login prompt

ct Ta num Ta 10
chat timeout for amp;ac and amp;ic scripts

dc Ta num Ta 0
chat debug bitmask

de Ta num Ta 0
delay secs and flush input before writing first prompt

df Ta str Ta %+
thestrftime(3) format used for amp;%d in the banner message

ds
str '^Y' delayed suspend character

dx Ta bool Ta false
set DECCTLQ

ec Ta bool Ta false
leave echo OFF

ep Ta bool Ta false
terminal uses even parity

er
str '^?' erase character

et
str '^D' end of text ( EOF) character

ev
str NULL initial environment

fl
str '^O' output flush character

hc Ta bool Ta false
do NOT hangup line on last close

he
str NULL hostname editing regular expression

hn Ta str Ta hostname
hostname

ht Ta bool Ta false
terminal has real tabs

hw Ta bool Ta false
do cts/rts hardware flow control

i0 Ta num Ta unused
tty input flags to write messages

i1 Ta num Ta unused
tty input flags to read login name

i2 Ta num Ta unused
tty input flags to leave terminal as

ic Ta str Ta unused
expect-send chat script for modem initialization

if Ta str Ta unused
display named file before prompt, like /etc/issue

ig Ta bool Ta false
ignore garbage characters in login name

im
str NULL initial (banner) message

iM
str NULL execute named file to generate initial (banner) message

in
str '^C' interrupt character

is Ta num Ta unused
input speed

kl
str '^U' kill character

l0 Ta num Ta unused
tty local flags to write messages

l1 Ta num Ta unused
tty local flags to read login name

l2 Ta num Ta unused
tty local flags to leave terminal as

lm Ta str Ta login:
login prompt

ln
str '^V' ``literal next'' character

lo
str /usr/bin/login program to exec when name obtained

mb Ta bool Ta false
do flow control based on carrier

nc Ta bool Ta false
terminal does not supply carrier (set clocal)

nl Ta bool Ta false
terminal has (or might have) a newline character

np Ta bool Ta false
terminal uses no parity (i.e., 8-bit characters)

nx Ta str Ta default
next table (for auto speed selection)

o0 Ta num Ta unused
tty output flags to write messages

o1 Ta num Ta unused
tty output flags to read login name

o2 Ta num Ta unused
tty output flags to leave terminal as

op Ta bool Ta false
terminal uses odd parity

os Ta num Ta unused
output speed

pc
str '\0' pad character

pe Ta bool Ta false
use printer (hard copy) erase algorithm

pf Ta num Ta 0
delaybetween first prompt and following flush (seconds)

pl Ta bool Ta false
start PPP login program unconditionally if amp;pp is specified

pp Ta str Ta unused
PPP login program

ps Ta bool Ta false
line connected to a MICOM port selector

qu
str 'amp;^\' quit character

rp
str '^R' line retype character

rt Ta num Ta unused
ring timeout when using amp;ac

rw Ta bool Ta false
do NOT use raw for input, use cbreak

sp Ta num Ta unused
line speed (input and output)

su
str '^Z' suspend character

tc Ta str Ta none
table continuation

to Ta num Ta 0
timeout (seconds)

tt
str NULL terminal type (for environment)

ub Ta bool Ta false
do unbuffered output (of prompts etc)

we
str '^W' word erase character

xc Ta bool Ta false
do NOT echo control chars as ‘^X

xf
str '^S ' XOFF(stop output) character

xn
str '^Q ' XON(start output) character

Lo Ta str Ta C
the locale name used for amp;%d in the banner message

The following capabilities are no longer supported by getty(8):

bd Ta num Ta 0
backspace delay

cb Ta bool Ta false
use crt backspace mode

cd Ta num Ta 0
carriage-return delay

f0 Ta num Ta unused
tty mode flags to write messages

f1 Ta num Ta unused
tty mode flags to read login name

f2 Ta num Ta unused
tty mode flags to leave terminal as

fd Ta num Ta 0
form-feed (vertical motion) delay

lc Ta bool Ta false
terminal has lower case

nd Ta num Ta 0
newline (line-feed) delay

uc Ta bool Ta false
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 stated direction only.

Terminal modes to be used for the output of the message, for input of the login name, and to leave the terminal set as upon completion, are derived from the boolean flags specified. If the derivation should prove inadequate, any (or all) of these three may be overridden with one of the amp;c0, amp;c1, amp;c2, amp;i0, amp;i1, amp;i2, amp;l0, amp;l1, amp;l2, amp;o0, amp;o1, or amp;o2 numeric specifications, which can be used to 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 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 amp;nx entry. If there is none, it will re-use its original table.

Delays are specified in milliseconds, the nearest possible delay available in the tty driver will be used. Should greater certainty be desired, delays with values 0, 1, 2, and 3 are interpreted as choosing that particular delay algorithm from the driver.

The amp;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 amp;pc.

The initial message, login message, and initial file; amp;im, amp;lm and amp;if may include any of the following character sequences, which expand to information about the environment in which getty(8) is running.
amp;%d The current date and time formatted according to the amp;Lo and amp;df strings.
amp;%h The hostname of the machine, which is normally obtained from the system using gethostname(3), but may also be overridden by the amp;hn table entry. In either case it may be edited with the amp;he POSIX "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.
amp;%t The tty name.
amp;%m, amp;%r, amp;%s, amp;%v The type of machine, release of the operating system, name of the operating system, and version of the kernel, respectively, as returned by uname(3).
amp;%% A "%" character.

When getty execs the login process, given in the amp;lo string (usually " /usr/bin/login"), it will have set the environment to include the terminal type, as indicated by the amp;tt string (if it exists). The amp;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 amp;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 amp;op or amp;np is specified. The amp;op string may be specified with amp;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. The getty(8) utility does not check parity of input characters in RAW mode.

If a amp;pp string is specified and a PPP link bring-up sequence is recognized, getty will invoke the program referenced by the amp;pp option. This can be used to handle incoming PPP calls. If the amp;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 amp;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 amp;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 amp;ct timeout, then a normal login sequence commences.

The amp;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 amp;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

login(1), gethostname(3), uname(3), termcap(5), getty(8), telnetd(8)

HISTORY

The gettytab file format appeared in BSD 4.2 .

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.


GETTYTAB (5) February 26, 2018

tail head cat sleep
QR code linking to this page


Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

Our grievance is not just against Unix itself, but against the cult of Unix zealots who defend and nurture it. They take the heat, disease, and pestilence as givens, and, as ancient shamans did, display their wounds, some self-inflicted, as proof of their power and wizardry. We aim, through bluntness and humor, to show them that they pray to a tin god, and that science, not religion, is the path to useful and friendly technology.
— The Unix Haters' handbook