.\" SPDX-License-Identifier: 0BSD .\" mandoc-ignore: WARNING: nested displays are not portable: Bd in Bd .\" mandoc doesn't have .in, like, at all, so .\" mandoc-ignore: UNSUPP: ignoring macro in table: %B Seventh Edition , .\" mandoc-ignore: UNSUPP: unsupported escape sequence:.*r$ .\" mandoc-ignore: UNSUPP: ignoring macro in table: sp .\" mandoc-ignore: WARNING: undefined escape, printing literally:.*=$ .\" https://inbox.vuxu.org/mandoc-discuss/20221017021749.2iieomqnf32ojxhg@tarta.nabijaczleweli.xyz/T/#u .\" mandoc-ignore: UNSUPP: ignoring macro in table: br .\" .Dd .Dt STTY 1 .Os . .Sh NAME .Nm stty .Nd inspect and alter teletype and window attributes .Sh SYNOPSIS .Nm .Op Fl F Ar teletype . .Nm .Op Fl F Ar teletype .Fl a . .Nm .Op Fl F Ar teletype .Fl g . .Nm .Op Fl F Ar teletype .Ar saved-settings . .Nm .Op Fl F Ar teletype .Cm size Ns \&| Ns Cm speed Ns \&| Ns Ar attribute Ns … . .Sh DESCRIPTION Writes (some) attributes of .Ar teletype .Pq the standard input stream by default or sets them. .Pp By default, a difference from .Nm Sy sane is written as such: .Bd -literal -compact -offset 4n speed 38400 baud; rows 48; cols 128; line = 1; iutf8 … .Ed or as such: .Bd -literal -compact -offset 4n ispeed 38400 baud; ospeed 19200 baud; rows 54; cols 226; line = 0; kill = ^Y; \-brkint \-imaxbel … .Ed if the speeds differ. .Pp The first line lists the teletype speed in bits per second .Pq which likely means very little if it's a Xr pty 4 , the kernel's idea of the window size, and the current line discipline. .Pp The next line lists the .Sx Special Control Characters in a visual format \(em .Qq Li if disabled, .Qq Li M- if top bit set, then literal if printable, else .Sy ^ Ns Ar b . .Pp Subsequent lines list the individial .Ar attribute Ns s for .Sx Input Attributes , .Sx Output Attributes , .Sx Control Attributes , and .Sx Local Attributes . . .Sh OPTIONS .Bl -tag -compact -width ".Fl F Ar teletype" .It Fl F Ar teletype Consult/modify .Ar teletype , opened .Dv "O_RDONLY | O_NONBLOCK" , instead of the standard input stream. .Pp . .It Fl a , -all Instead of the control characters and attributes that differ between the current settings and the current settings with .Sy sane applied, list .Em all known characters and attributes of the current settings, negated if applicable. . .It Fl g , -save Write current settings in a concise reproducible format suitable for use as .Ar saved-settings , cf.\& .Sx Saved Settings , below. .El . .Sh ATTRIBUTES Specifying any attribute except for .Oo Sy \- Oc Ns Sy drain suppresses the default output. . .Ss Queries Write information about .Ar teletype to the standard output stream. .Pp .\" mandoc compat; https://inbox.vuxu.org/mandoc-discuss/20220529001500.gnxuiiawdegcjwy7@tarta.nabijaczleweli.xyz/T/ .if !ddoc-Em-font .ds doc-Em-font \fI .if !ddoc-Sy-font .ds doc-Sy-font \fB .if !ddoc-Cm-font .ds doc-Cm-font \f(CB .if !ddoc-Nm-font .ds doc-Nm-font \f(CB .if !ddoc-Fn-font .ds doc-Fn-font \f(CB .if !ddoc-Ar-font .ds doc-Ar-font \f(CI .if !ddoc-Fa-font .ds doc-Fa-font \f(CI .if !ddoc-Sx-font .ds doc-Sx-font \fI .if !ddoc-Dv-font .ds doc-Dv-font \f(CR .if !ddoc-Ev-font .ds doc-Ev-font \f(CR .if !ddoc-Xr-font .ds doc-Xr-font \f(CR .if !ddoc-Li-font .ds doc-Li-font \f(CR .if !ddoc-Va-font .ds doc-Va-font \fI .if !ddoc-Pa-font .ds doc-Pa-font \fI .if !ddoc-Tn-font-size .ds doc-Tn-font-size \s+0 .\" The table headers assume Sy is a hard B and Li/Dv is a hard C and Va is a hard I and Fa is a hard CI everywhere .TS lb lb lb l l l . Query Information Format _ \*[doc-Cm-font]size\fP Window size Rows, then columns, separated by a space \*[doc-Cm-font]speed\fP Baud-rate Single number if the same, otherwise input speed, space, output speed .TE . .Ss Special Control Characters Must be followed by either the empty string, meaning .Sy 0x00 , a single byte, used verbatim, .Qq Li ^- or .Qq Li undef , disabling the character, .Qq Li ^?\& for .No DEL Pq Sy 0x7F , No bottom 7 bits set , .Qq Sy ^ Ns Ar b where .Ar b is any byte, of which the bottom .Sy 5 bits are used (this most likely corresponds to holding the Control key on your keyboard, then pressing the desired character, and yields distinct favourable results for .Sy @ , the alphabet, brackets, .Sy \e , ^ , No and Sy _ ) , or an integer. .Pp .TS l1 l1b lb lb lb lfCR l lb . \*[doc-Dv-font]cc\fP Index Purpose When _ intr VINTR Send \*[doc-Dv-font]SIGINT\fP to foreground process group isig quit VQUIT Send \*[doc-Dv-font]SIGQUIT\fP to foreground process group isig erase VERASE Erase last character icanon kill VKILL Kill whole line icanon eof VEOF Discard the \*[doc-Sy-font]eof\fP and terminate line immediately icanon eol VEOL Alternative keying for the newline icanon eol2 VEOL2 Likewise icanon swtch VSWTCH cf. \*[doc-Sx-font]HISTORY\fP, \*[doc-Sx-font]UNIX System V Release 2.0\fP \fRSVr2 & \fP\*[doc-Xr-font]shl\fP\fR(1)\fP start VSTART Resume output suspended with \*[doc-Sy-font]stop\fP ixon\fR, \fPixoff stop VSTOP Temporarily halt output to \*[doc-Ar-font]teletype\fP \^ susp VSUSP Send \*[doc-Dv-font]SIGTSTP\fP to foreground process group isig rprnt VREPRINT Re-echo current input line iexten\fR & \fPecho discard VDISCARD Toggle \*[doc-Sy-font]flusho\fP iexten werase VWERASE Erase last word icanon lnext VLNEXT Next byte is literal \(em all processing is turned off iexten dsusp VDSUSP Like \*[doc-Sy-font]susp\fP, but sent when the byte would be read, not instantly isig status VSTATUS Send \*[doc-Dv-font]SIGINFO\fP to foreground process group icanon .TE .Pp These are also part of the .Sx Special Control Characters , but aren't actually characters, and control non-canonical input; as such, they take an integer only: .TS l1 l1b lb lb lb lfCR l lb . \*[doc-Dv-font]cc\fP Index Purpose When _ min VMIN Minimum bytes to return from a \*[doc-Nm-font]read\fP() \-icanon time VTIME Tenths of a second to allow a \*[doc-Nm-font]read\fP() to block \-icanon .TE If both are nonzero, wait at most .Sy time after the last received byte that didn't satisfy .Sy min to return. If neither \(em .Fn read returns immediately with whatever's available. . .Ss Input Attributes Except where specified otherwise, these all correspond to flags of the same name, but in upper-case. A BREAK means being on the receiving end of a .Xr tcsendbreak 3 . .Pp .TS l1b l1b lb lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l lb lb lb l s lb lb l lb . Attrib. Inverse Purpose When _ ignbrk \-ignbrk Discard BREAKs brkint \-brkint Send \*[doc-Dv-font]SIGINT\fP to foreground process group under BREAK \-ignbrk ignpar \-ignpar Discard framing/parity errors parmrk \-parmrk (see below) inpck \-inpck Check received parity for correctness istrip \-istrip Strip input bytes to \*[doc-Sy-font]7\fP bits inlcr \-inlcr Convert input newlines to carriage returns igncr \-igncr Discard input carriage returns icrnl \-icrnl Convert input carriage returns to newlines iuclc \-iuclc Convert upper-case input bytes to lower-case iexten\fR, after \fPistrip ixon \-ixon Handle \*[doc-Sy-font]start\fP and \*[doc-Sy-font]stop\fP and as-described ixany \-ixany Allow any input byte to resume \*[doc-Sy-font]stop\fPped output ixon ixoff \-ixoff Send \*[doc-Sy-font]start\fP and \*[doc-Sy-font]stop\fP to the input to prevent input queue overflow imaxbel \-imaxbel Ring bell when input queue full iutf8 \-iutf8 Process input line as UTF-8 instead of byte-wise icanon .\" iutf8 is linux-only .TE .Pp If .Sy \-ignpar parmrk , framing/parity errors yield bytes .Sy 0xFF , 0 , then the erroneous one; to disambugate, normal .Sy 0xFF bytes are doubled unless .Sy istrip in this case. If .Sy \-ignpar \-parmrk \(em a single .Sy 0 byte. .Pp If .Sy \-ignbrk \-parmrk , a break condition yields a single .Sy 0 byte, if .Sy \-ignbrk parmrk \(em .Sy 0xFF , 0 , 0 . . .Ss Output Attributes These allow correct output to quirky or moving teletypes. .Pp .TS l1b l1b lb lb lb l lb lb l lb lb l lb lb l lb lb l lb lb l lb lb l lb lb l rb s l . Attrib. Inverse Purpose _ opost \-opost Enable all other \*[doc-Sx-font]Output Attributes\fP olcuc \-olcuc Convert lower-case bytes to upper-case for output onlcr \-onlcr Output newline as carriage return, newline ocrnl \-ocrnl Output carriage return as newline onocr \-onocr Don't output carriage return at the first column onlret \-onlret Assume newline returns carriage to first column; use \*[doc-Sy-font]cr?\fP delays instead ofill \-ofill Transmit \*[doc-Sy-font]0\fP bytes as filler instead of using time-based delays ofdel \-ofdel Use DEL (\*[doc-Sy-font]0x7F\fP)s instead of \*[doc-Sy-font]0\fPs = nl0 No newline delay nl1 Approximately \*[doc-Sy-font]0.10s\fP or two filler bytes .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& cr0 No carriage return delay cr1 Dependent on current column or two filler bytes cr2 Approximately \*[doc-Sy-font]0.10s\fP or four filler bytes cr3 Approximately \*[doc-Sy-font]0.15s\fP \ \& tab0 No tab delay tab1 Dependent on current column or two filler bytes tab2 Approximately \*[doc-Sy-font]0.10s\fP or two filler bytes tab3 Expand tabs to spaces \ \& bs0 No backspace delay bs1 Approximately \*[doc-Sy-font]0.05s\fP or a filler byte \ \& ff0 No form-feed delay ff1 Approximately \*[doc-Sy-font]2s\fP \ \& vt0 No vertical tab delay vt1 Approximately \*[doc-Sy-font]2s\fP .TE . .Ss Control Attributes .TS l1b l1b lb lb rb s l s rb s l s rb s l s rb s l s lb lb l l lb lb l l lb lb l l lb lb l l lb lb l s lb lb l s lb lb l l . Attrib. Inverse Purpose Inverse Purpose _ cs5 \*[doc-Ar-font]teletype\fP bytes are 5 bits cs6 \*[doc-Ar-font]teletype\fP bytes are 6 bits cs7 \*[doc-Ar-font]teletype\fP bytes are 7 bits cs8 \*[doc-Ar-font]teletype\fP bytes are 8 bits = cstopb \-cstopb Send two stop bits Send one cread \-cread Enable receiver Don't receive (read) anything parenb \-parenb Generate a parity bit for each byte Don't parodd \-parodd Odd parity Even parity hupcl \-hupcl Hang up when the last file descriptor for \*[doc-Ar-font]teletype\fP is closed clocal \-clocal Local line \(em ignore link status .\" https://viereck.ch/linux-mark-space-parity/ cmspar \-cmspar (see below) Normal parity crtscts \-crtscts Hardware flow control No hardware flow control .\" cmspar is linux-only .TE If .Sy cmspar \-parodd : space .Pq Pf always- Sy 0 parity; if .Sy cmspar parodd : mark .Pq Pf always- Sy 1 parity. . .Ss Local Attributes .TS l1b l1b l1b l1b lb lb lb l s s lb lb l l s lb lb l s lb lb lb l l s lb lb l s lb lb lb l l lb lb lb l l lb lb lb l s lb lb lb l s lb lb lb l s s lb lb l s lb lb lb l s lb lb lb l l s lb lb l s s . Attrib. Inverse Purpose Inverse Purpose When _ isig \-isig Send signals when \*[doc-Sy-font]intr\fP, \*[doc-Sy-font]quit\fP, \*[doc-Sy-font]susp\fP, or \*[doc-Sy-font]dsusp\fP icanon \-icanon Canonical editable line-buffered input Raw input, \*[doc-Sy-font]min\fPimally-buffered xcase \-xcase (see below) icanon echo \-echo Echo input back Input is hidden echoe \-echoe (see below) icanon\fR & \fPecho echok \-echok Represent \*[doc-Sy-font]kill\fP (per [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoke\fP) Echo \*[doc-Sy-font]kill\fP per \*[doc-Sy-font]echoctl\fP icanon\fR & \fPecho echoke \-echoke \*[doc-Sy-font]kill\fP by erasing the whole line \*[doc-Sy-font]kill\fP by echoing a newline \fR\(ua & \fPechok echonl \-echonl Echo newlines regardless of \*[doc-Sy-font]echo\fP icanon noflsh \-noflsh Don't discard buffers when sending signals due to \*[doc-Sy-font]isig\fP isig tostop \-tostop Send \*[doc-Dv-font]SIGTTOU\fP to background process group attempting output \" Allow the write echoctl \-echoctl Echo control bytes (sans \*[doc-Sy-font]start\fP, \*[doc-Sy-font]stop\fP) as \*[doc-Sy-font]^\fP\*[doc-Ar-font]b\fP instead of verbatim echo .\" also sans newline and tab but :v echoprt \-echoprt (see below) icanon\fR & \fPecho flusho \-flusho Output discarded Output flowing iexten \-iexten Enable implementation-defined flags extproc \-extproc External processing for \*[doc-Xr-font]pty\fP(4)s, cf. \*[doc-Nm-font]ioctl\fP(\*[doc-Dv-font]TIOCPKT\fP) altwerase \-altwerase Use alternative word-breaking algorithm for \*[doc-Sy-font]werase\fP .TE .Pp Blocking .Dv SIGTTOU has the same effect as setting .Sy \-tostop for the process would. .Pp On systems where .Sy xcase does anything, a backslash followed by a lowercase byte is converted to an uppercase byte, and a backslash followed by any of .Li "'!^()\e" becomes .Li "`|~{}\e" , respectively. Output is written with the mapping applied in reverse. .\" TODO: is this clear? .Pp When erasing .Pq Sy icanon .Pq via Sy erase , werase , kill No with Sy echok echoke , No &c.\& , if .Sy echo : .Bl -tag -compact -offset 4n -width ".No if Sy echoprt" .\" Adapted from Linux v6.0-rc1; this roughly matches illumos manuals .It if Sy echoprt echo a backslash, each erased column in erasure order; if another byte on the same line is echoed, the first is preceded with a slash; this is friendly to .Ar teletype Ns s that display to write-once media like paper, .It if Sy echoe No and erased via Sy erase echo .Sy erase , .It otherwise , echo backspace, space, backspace; this works best for re-writable media since it hides the erased bytes. .El .Pp On systems where .Sy flusho does anything, it's enabled by .Sy discard and disabled by any input. . .Ss Line Speed .TS lb lb lb l . Attrib. Purpose _ \*[doc-Ar-font]speed\fP Equivalent to \*[doc-Sy-font]ospeed\fP \*[doc-Ar-font]speed\fP \*[doc-Sy-font]ispeed\fP \*[doc-Ar-font]speed\fP \*[doc-Sy-font]ispeed\fP \*[doc-Ar-font]speed\fP Sets input baud-rate to \*[doc-Ar-font]speed\fP, or same as \*[doc-Sy-font]ospeed\fP if \*[doc-Sy-font]0\fP \*[doc-Sy-font]ospeed\fP \*[doc-Ar-font]speed\fP Sets ouput baud-rate to \*[doc-Ar-font]speed\fP, or hangs up if \*[doc-Sy-font]0\fP .TE .Pp Where .Ar speed is any of: .TS l4zw0 nb nb nb nb nb nb . 50 200 2400 57600 576000 2000000 75 300 4800 115200 921600 2500000 110 600 9600 230400 1000000 3000000 134.5 1200 19200 460800 1152000 3500000 150 1800 38400 500000 1500000 4000000 .TE all of which correspond to directly to the gross-bits-per-second speed of the link, or one of the following: .TS l4zw0 nb lz l4zw0 nb nb l4zw0 nb nb l4zw0 nb nb . 0 (see above) 134 134.5 exta 19200 extb 38400 .TE .Pp Under Linux, .Sy 38400 potentially means .Sy 57600 , 115200 , 230400 , 460800 , or some division of the clock, depending on additional link-specific configuration .Pq Nm ioctl Ns Po Dv TIOCSSERIAL Pc , Xr setserial 8 Cm spd_hi Ns /\: Ns Cm spd_vhi Ns /\: Ns Cm spd_shi Ns /\: Ns Cm spd_warp Ns /\: Ns Cm spd_cust divisor , . .Ss Windowing These take a single integer; the "window" is the systems's concept of the window dimensions \(em these won't resize an emulator, but can help get full-size windows and user-space wrapping on a remote system. .Pp .TS l2b l2b lb lb l l . Dimension Dimension Unit _ rows Vertical Lines cols Horizontal Columns .TE . .Ss Line Discipline Takes a single integer as .Qq Sy line Ar discipline , which determines how bytes are packaged for delivery to/from the peer; in many ways this could be considered the "protocol" \(em "raw serial", X.25, GSM, PPP, &c. There should be no reason to set this manually. . .Ss Flushing .TS l2b lb lb l . Argument Effect _ drain Block until all output is processed (\*[doc-Dv-font]TCSADRAIN\fP); this is the default \-drain Affect the changes immediately (\*[doc-Dv-font]TCSANOW\fP) .TE . .Ss Combos .\" All more-than-one-aliases are sorted with respect to the ordering in this file! .TS l2b lb lb lx . Argument Effect _ ek Set \*[doc-Sy-font]erase\fP and \*[doc-Sy-font]kill\fP to their default values raw Clear \*[doc-Em-font]all\fP \*[doc-Sx-font]Input Attributes\fP, \*[doc-Sy-font]min 1 time 0 \-opost \-isig \-icanon \-xcase\fP cooked Set \*[doc-Sy-font]eof\fP and \*[doc-Sy-font]eol\fP to their default values, \*[doc-Sy-font]brkint ignpar istrip icrnl ixon opost isig icanon\fP sane T{ Set all \*[doc-Sx-font]Special Control Characters\fP to their default values, \*[doc-Sy-font]\-ignbrk brkint \-inlcr \-igncr icrnl \-iuclc \-ixany \-ixoff imaxbel \-iutf8 opost \-olcuc onlcr \-ocrnl \-onocr \-onlret \-ofill \-ofdel nl0 cr0 tab0 bs0 ff0 vt0 cread isig icanon \-xcase echo echoe echok echoke \-echonl \-noflsh \-tostop echoctl \-echoprt \-flusho iexten \-extproc\fP T} .TE . .Ss Aliases .\" All lists are ordered with respect to the global position in this page .\" The rows are ordered by the values, likewise .TS l2b lb lb lb lb lb lb lb . Argument Inverse Is Inverse Is _ reprint rprnt decctlq \-decctlq \-ixany ixany tandem \-tandem ixoff \-ixoff tabs \-tabs tab0 tab3 hup \-hup hupcl \-hupcl cbreak \-cbreak \-icanon icanon crterase \-crterase echoe \-echoe crtkill \-crtkill echoke \-echoke ctlecho \-ctlecho echoctl \-echoctl prterase \-prterase echoprt \-echoprt columns cols \-cooked raw \-raw cooked lcase \-lcase LCASE \-LCASE parity \-parity evenp \-evenp \-oddp \-evenp .TE . .Ss Gang Aliases .TS l2b lb lb lb . Argument Is _ \h'\w'\-'u'dec intr ^C erase ^? kill ^U \-ixany echoe echoke echoctl \h'\w'\-'u'litout \-istrip \-opost cs8 \-parenb \-litout istrip opost cs7 parenb \h'\w'\-'u'pass8 \-istrip cs8 \-parenb \-pass8 istrip cs7 parenb \h'\w'\-'u'nl \-icrnl \-onlcr \-nl \-inlcr \-igncr icrnl onlcr \-ocrnl \-onlret \h'\w'\-'u'LCASE iuclc olcuc xcase \-LCASE \-iuclc \-olcuc \-xcase \h'\w'\-'u'oddp cs7 parenb parodd \h'\w'\-'u'evenp cs7 parenb \-parodd \-evenp cs8 \-parenb \h'\w'\-'u'crt echoe echoke echoctl .TE . .Ss Saved Attributes .Sx Input Attributes , .Sx Output Attributes , .Sx Control Attributes , .Sx Local Attributes , then all .Sx Special Control Characters , hexadecimal, colon-separated. .Pp Naturally, this doesn't preserve/restore .Sx Windowing information or the .Sx Line discipline . . .Sh EXIT STATUS .Sy 1 if .Ar teletype couldn't be opened, new attributes couldn't be applied, or they weren't fully updated .Pq the state after applying wasn't the state being applied \(em most likely this means altering a read-only attribute for the Ar teletype . . .Sh EXAMPLES Undo any weird modes, kill line with .Sy ^ Ns Ar K : .Bd -literal -compact -offset 4n .Li $ Nm Ar sane kill Li ^ Ns Ar K .Ed .Pp Fully-portably save/restore .Ar teletype state around querying the teletype size .\" https://web.archive.org/web/20200114161545/http://vt100.net/dec/vt_history.html starts at 300, the VT100 has ANSI escapes .Pq provided the line speed is at least Sy 110 , No which all Tn ANSI Ns -X3.64-compliant video terminals support : .Bd -literal -compact -offset 4n #!/bin/sh .Li saved=$( Ns Nm stty Fl g Ns Li \&; Nm printf Li \&"rows %u cols %u" $( Ns Nm stty Cm size Ns Li )) .\" bash-only: .\" .Nm stty Li \-echo .\" .Dv IFS Ns Li ='[;' Ic read Fl rd Ns Li R Ar _ r c .Nm stty Ar \-echo \-icanon min 0 time 1 .Nm printf Li \&'\e033[%s' s '99999;99999;H' 6n u .Dv IFS Ns Li ='[;R' Ic read Fl r Ar _ r c .Ic echo Li rows Ar $r Li cols Ar $c .Nm stty Ar $saved .Ed . .Sh SE\&E ALSO \" "SEE ALSO" makes .Rs start a block .Xr tcgetattr 3 , .Xr tcgetwinsize 3 , .Xr termios 4 , .Xr tty 4 , .Xr ascii 7 .Pp .Pa /proc/tty/ldiscs , under Linux, listing .Ar discipline mappings .Pp High-level teletype semantics that result from these settings .Pq Sy raw No and Sy cooked No in particular : .br .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D November 3, 1971 .%O \*[doc-Xr-font]/dev/tty0 ... tty5\fP (IV) .%P pp. 162-164 .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v1/UNIX_ProgrammersManual_Nov71.pdf .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v1/\:UNIX_ProgrammersManual_Nov71.pdf .Re . .Sh STANDARDS Conforms to the .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 base spec, and, except where specified, its XSI parts \(em .Fl ag are standard, also cf.\& .Sx Standard Attributes , below. No format is specified: .Fl a must include: the .Sx ATTRIBUTES , separated by spaces, but may (and other implementations do) include additional information; .Qq Li speed or .Qo Li ispeed Qc Ns / Ns Qq Li ospeed if they're different, in the format listed in the .Sx DESCRIPTION , up to the semicolon, of which only "baud" is localisable; and .Sx Special Control Characters in the format listed in the .Sx DESCRIPTION , the value being either .Qq Li , if undefined, the literal character if printable, or a "visual representation" thereof \(em this implementation's .Li M- prefix for the top bit and .Li ^@ for .Sy 0 matches the GNU system. .Pp The default output is to be a "subset" of .Fl a \(em this in general means delta from some default settings .Pq and maybe additional data considered relevant, like Sy min No and Sy time No if Sy \-icanon . .Pp The .Fl g output is required to not require quoting (but may field-split, so it shouldn't be quoted for portability) and is required to save all standard .Sx ATTRIBUTES except .Sx Windowing information, which is optional .Pq this naturally also excludes the Sx Line Discipline . This implementation's format matches the GNU system's, which is equivalent to .At III . .Pp .Fl F is an extension, compatible with the GNU system .Pq Bx 4.4 No spells it Fl f Ns ", " but that clashes with Sy \-flusho ; .Dv O_NONBLOCK means that this can be used on devices that aren't usable yet, and would block if spelled .Li < Ar teletype .Pq cf. Xr open 2 . .Pp Speeds as reported in .Pf no-argument/ Fl a output and in .Cm speed are truncated .Pq i.e. Sy 134.5 No is reduced to Qq Sy 134 ; the former for conformance, the latter for compatibility. . .Ss Standard Attributes .Ss Queries .Cm size , as described; exactly one space. . .Ss Special Control Characters .Sy intr , quit , erase , kill , eof , eol , start , stop , susp , with arguments as-described .Pq except for empty-string-as- Ns Sy 0 , No an extension , but .Sy ^ Ns Ar b is defined explicitly for the alphabet, brackets, .Sy \e , ^ , No and Sy _ . .Pp .Sy min , time , with just an integer, as-described. .Pp .Dv VMIN is allowed to be .Dv VEOF , and .Dv VTIME VEOL , which is why .Sy raw and .Sy cooked set them, respectively. . .Ss Input Attributes All as-described. .Pp .TS l2b lb|l2b lb|l2b lb|l2b lb . Attrib. Inverse Attrib. Inverse Attrib. Inverse Attrib. Inverse _ ignbrk \-ignbrk parmrk \-parmrk inlcr \-inlcr ixon \-ixon brkint \-brkint inpck \-inpck igncr \-igncr ixany \-ixany ignpar \-ignpar istrip \-istrip icrnl \-icrnl ixoff \-ixoff .TE . .Ss Output Attributes .Sy opost and .Sy \-opost are part of the base spec, and as-described. All others are shaded XSI: .Pp .TS l2b lb|l2b lb|l2b lb lb lb|lb lb|lb lb lb lb|lb lb|lb lb rb rb rb rb . Attrib. Inverse Attrib. Inverse Attrib. Inverse _ onlcr \-onlcr onocr \-onocr ofill \-ofill ocrnl \-ocrnl onlret \-onlret ofdel \-ofdel = nl0 nl1 cr0 cr1 cr2 cr3 tab0 tab1 tab2 tab3 bs0 bs1 ff0 ff1 vt0 vt1 .TE . .Ss Control Attributes All as-described. .Pp .TS l2b lb|l2b lb|l2b lb rb rb rb rb lb lb|lb lb|lb lb . Attrib. Inverse Attrib. Inverse Attrib. Inverse _ cs5 cs6 cs7 cs8 = cstopb \-cstopb parenb \-parenb hupcl \-hupcl cread \-cread parodd \-parodd clocal \-clocal .TE . .Ss Local Attributes All a superset of described. .Pp .TS l2b lb lb lb lb l . Attrib. Inverse Note _ isig \-isig icanon \-icanon echo \-echo echoe \-echoe Defined generically as erasing the last character from the display, else \*[doc-Sy-font]echo\fP applies echok \-echok [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoke\fP selects between the two allowed behaviours echonl \-echonl noflsh \-noflsh tostop \-tostop iexten \-iexten If \*[doc-Sy-font]\-iexten\fP, \*[doc-Sy-font]icanon\fP, \*[doc-Sy-font]isig\fP, \*[doc-Sy-font]ixon\fP, and \*[doc-Sy-font]ixoff\fP are guaranteed to behave conformantly .TE . .Ss Line Speed Either .Qq Ar number for "terminal baud rate" or .Qo Sy ispeed Ar number Qc Ns / Qq Sy ospeed Ar number for "terminal input baud rate"/"terminal output baud rate", with .Sy 0 semantics as described. The speeds supported are at .Em least : .TS l4zw0 n lfCR . Hang up B0 \*[doc-Sy-font]50\fP baud B50 \*[doc-Sy-font]75\fP baud B75 \*[doc-Sy-font]110\fP baud B110 \*[doc-Sy-font]134.5\fP baud B134 \*[doc-Sy-font]150\fP baud B150 \*[doc-Sy-font]200\fP baud B200 \*[doc-Sy-font]300\fP baud B300 \*[doc-Sy-font]600\fP baud B600 \*[doc-Sy-font]1200\fP baud B1200 \*[doc-Sy-font]1800\fP baud B1800 \*[doc-Sy-font]2400\fP baud B2400 \*[doc-Sy-font]4800\fP baud B4800 \*[doc-Sy-font]9600\fP baud B9600 \*[doc-Sy-font]19200\fP baud B19200 \*[doc-Sy-font]38400\fP baud B38400 .TE .Pp It's unclear what the minimum required mapping to the .Ar number Ns s for these is. . .Ss Windowing .Sy rows and .Sy cols , as described. .Pp See also the standard .Ev LINES and .Ev COLUMNS environment variables in .Xr environ 7 . . .Ss Line Discipline Not part of the standard. . .Ss Flushing The standard doesn't require .Nm to use .Xr tcsetattr 3 , and doesn't specify any flushing characteristics. . .Ss Combos .TS lb l . ek As described sane "Reset all modes to some reasonable, unspecified, values." oddp As described evenp As described \-evenp As described .TE . .Ss Aliases All as-described. .Pp .TS l2b lb . Argument Inverse _ tabs \-tabs hup \-hup \-raw parity \-parity \-oddp .TE . .Ss Gang Aliases .TS l2b lb l2b lb lb lb l lb lb lb lb . Argument Inverse Is Inverse Is _ raw cooked (see below) nl \-nl \-icrnl \-inlcr \-igncr icrnl .TE .Pp .Sy raw .Pq and Sy \-raw , cooked is shaded XSI, and supposed to enable (or disable for the inverse) "raw input and output". This raw mode is supposed to be equivalent to .Qq Sy cs8 erase Li ^- Ns Sy " kill" Li ^- Ns Sy " intr" Li ^- Ns Sy " quit" Li ^- Ns Sy " eof" Li ^- Ns Sy " eol" Li ^- Ns Sy " \-post" \-inpck ; what .Sy cooked is supposed to mean is unclear. This implementation's aliases match the GNU system's. .Pp The additional .Sy \-onlcr for .Sy nl and .Sy onlcr \-ocrnl \-onlret for .Sy \-nl match the GNU system, and, since the additional attributes are shaded XSI while .Oo Sy \- Oc Ns Sy nl isn't, may be considered a safe extension. . .Ss Obsolescent Aliases .St -susv3 removes the following, previously marked LEGACY and shaded EX (equivalent to present-day XSI). .Pp .TS l2b lb lb lb lb l . Argument Inverse Note _ iuclc \-iuclc T{ Defined in terms of characters and only in the \*[doc-Dv-font]POSIX\fP locale; a problem, given that locales are user-space, unlike the line and teletype drivers T} olcuc \-olcuc \^ xcase \-xcase Performs "canonical lower and canonical upper presentation", unexplained lcase \-lcase As described LCASE \-LCASE \^ .TE .Pp .\" TODO: remove this when we get a final 202x probably (Nominally, .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 doesn't contain .Sy \-xcase , but this appears to be a .\" https://www.mail-archive.com/austin-group-l@opengroup.org/msg10123.html .Lk https://www.mail-archive.com/\:austin-group-l@opengroup.org/\:msg10123.html mistake in the .Sx CHANGE HISTORY . ) . .Sh HISTORY .Ss UNIX Programmer's Manual .Xr gtty II and .Xr stty II syscalls appear in the first edition of the UNIX Programmer's Manual, operating on the .Tn DC11 asynchronous communications interfaces attached (\c .%B UNIX Programmer's Manual , \*[doc-Xr-font]/dev/tty0 ... tty5\fP (IV)) , but not the console (ibid., \*[doc-Xr-font]/dev/tty\fP (IV), p. 161) .Tn Teletype Model 33 ASR typewriter which is an integral part of the .Tn PDP-11 . .Pp .Xr stty II (ibid., p. 135) takes a file descriptor and a pointer to three 16-bit integers, the first of which .Pq Fa dcrsr "is placed into the typewriter's reader control and status register", and the second .Pq Fa dcpsr "is placed in the printer control and status register" \(em it then defers to the .Tn DC11 manual for their format and "until the typewriter is quiescent" .Pq Sy drain , Dv TCSADRAIN ; the .Sx BUGS section notes: .Dl "This call should be used with care. It is all too easy to turn off your typewriter."\& .Pp Indeed, the .Tn DC11 Ns 's two registers are the Receiver Status Register .Pq Va RCSR , laid out as such (in short; read-only bits and bit .Sy 8 omitted), compared to the present-day equivalents: .TS l4zw0 n1b l2i l sx l4zw0 n1b l2i l l l4zw0 n1b l2i l l l4zw0 n1b l2i l sx l4zw0 n1b l2i l l . 0 DATA TERMINAL READY T{ Controls receiving data from modem \(em if \*[doc-Sy-font]0\fP, no input is processed. All too easy indeed! T} 1 BREAK Outputs a BREAK if set \*[doc-Xr-font]tcsendbreak\fP(3) \fR[\fP3\fR, \fP4\fR]\fP RECEIVER SPEED SELECT (see below) \*[doc-Xr-font]cfsetispeed\fP(3) 6 INTERRUPT ENABLE T{ The \*[doc-Tn-font-size]DC11\s0 will send an interrupt if there's data. Clearing this would likely also "turn off" the teletype. T} \fR[\fP9\fR, \fP10\fR]\fP CHARACTER LENGTH \*[doc-Sy-font]8\fP \- the value, i.e. down to \*[doc-Sy-font]5\fP \*[doc-Sy-font]cs\fP[\*[doc-Sy-font]5678\fP] .TE and the Transmitter Status Register .Pq Va TSCR (in short; read-only bits and bit .Sy 2 omitted): .TS l4zw0 n1b l2i l sx l4zw0 n1b l2i l l l4zw0 n1b l2i l sx l4zw0 n1b l2i l l . 0 REQUEST TO SEND Controls sending data to modem. \fR[\fP3\fR, \fP4\fR]\fP TRANSMITTER SPEED SELECT (see below) \*[doc-Xr-font]cfsetospeed\fP(3) 6 INTERRUPT ENABLE T{ Send an interrupt if ready to send byte. Setting this inadvertently would most likely have undesirable effects. T} 8 STOP CODE \*[doc-Sy-font]2\fP stop bits \- the value [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]cstopb\fP .TE .Pp The .Va SPEED SELECT fields select between the four speeds available on the specific .Tn DC11 model \(em according to \*[doc-Xr-font]/etc/init\fP (VII) (ibid., p. 202) and \*[doc-Xr-font]logging in and logging out\fP(VII) (ibid., p. 208) the default teletype is a .Sy 150 Ns -baud .Tn Model 37 Teletype with a BREAK at the .Qq Li login:\& prompt selecting the .Sy 300 Ns -baud .Tn GE TermiNet 300 ; \*[doc-Xr-font]type\fP(I) (ibid., p. 101) supports printing to .Sy 134.5 Ns -baud .Tn IBM 2741 Ns s \(em the remaining speed required to disambugate the model used is .Sy 1200 No baud , given in \*[doc-Xr-font]/dev/tty0 ... tty5\fP (IV), points squarely at the .Tn DC11-AG . .Pp These are described in grueling detail in .Rs .%C Maynard, Massachusetts .%D September 1973 .%N 5th Printing .%P Chapter 3 (Operational Programming) .%Q Digital Equipment Corporation .%R DEC-11-HDCD-D .%T DC11 asynchronous line interface manual .\" http://bitsavers.org/pdf/dec/unibus/DEC-11-HDCD-D_DC11_Asynchronous_Line_Interface_Sep73.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:DEC-11-HDCD-D_DC11_Asynchronous_Line_Interface_Sep73.pdf .Re .Pp The third integer is the .Fa mode , whose contents "determine the system's treatment of the typewriter" (octal): .Bd -literal -compact 200 even (M37 tty) parity allowed 100 odd (non-M37 tty) allowed 040 raw mode: wake up on all characters 020 map CR into LF; echo LF or CR as CR-LF 010 don't echo (half duplex) 004 map upper case to lower case on input (M33 TTY) .Ed Received bytes with invalid parity are discarded. The closest present-day analogue to .Li 300 is .Sy parodd to .Li 100 and .Sy \0parodd to .Li 200 , but allowing both is valid and common in this case. .Pp Raw mode is the moral equivalent of present-day, well, .Sy raw , but spelled as the inverse of the default .Sy icanon (with .Sy min 1 time 0 ) implied: "every character is passed back immediately to the program. No erase or kill processing is done; the end-of-file character (EOT), the interrupt character (DELETE) and the quit character (FS) are not treated specially."; today, .Sy erase , kill , and .Sy eof are predicated on .Sy icanon directly, and .Sy intr and .Sy quit on .Sy isig . .Pp .Li 020 is equivalent to .Sy icrnl onlcr , "used for GE TermiNet 300's". .br .Li 010 can be recognised as .Sy \-echo and .Li 004 \(em .Sy iuclc . .Pp The delays are hard-coded for the .Tn Model 37 . It's unclear if they're the same at .Sy 300 baud or if they're altered for the .Tn TermiNet , except that it (supposedly) works. .Pp The .Sx Special Control Characters are unchangeable: .Bl -tag -compact -offset 4n -width ".Sy erase" .It Sy intr .Tn ASCII DELETE .Pq Sy ^?\& , 0x7F , "sometimes called »rub-out«"; (see below) . .It Sy quit .Tn ASCII FS .Pq Sy ^ Ns Ar \e Ns Sy ", 0x1C" , (see below) . .It Sy eof .Tn ASCII EOT .Pq End Of Transmission , Sy ^ Ns Ar D Ns Sy ", 4" , as present-day . .It Sy erase .Sy # .Pq with Sy \e# No typed for literal Li # , as present-day . .It Sy kill .Sy @ .Pq with Sy \e@ No typed for literal Li @ , as present-day .El It's important to note that no additional output processing is done for erasing, à la .Sy echoe \-echok . .Pp .Sy intr and .Sy quit represent a primitive form of signals .Pq even before signals got signals, job control is Em king Ns .\& it is known : "for practical purposes at random" a process whose .Em control typewriter \(em the first .Pa /dev/tty* file opened by the process, inherited on .Xr fork II .Pq cf. today's similar but much more complex Xr credentials 7 ; this means all processes in a login session share the same one \(em matches the one on which the .Sy intr Pq Sy quit was received and which hasn't ignored the "signal" by passing .Sy 0 to .Xr intr II (\c .%B UNIX Programmer's Manual , p. 122) .Pq Xr quit II No (ibid., p. 127)) , is "forced to exit" (and dump core). (If a funciton is passed to .Xr intr II Pq Xr quit II it is executed, but this causes a cascade of errors that make it not worthwhile, and, as the .Sx BUGS proclaim: "I don't know how to make it work.".) .Pp Hanging up the call makes all future reads return empty (the Manual calls this simulating end-of-file); nowadays, a .Dv SIGHUP is also delivered to the foreground process group. .Pp .Xr gtty II (ibid., p. 120), expectedly, copies those three integers into the provided buffer. .Pp \*[doc-Xr-font]/dev/tty\fP (IV) (the "hard-wired" "console typewriter") is nominally out-of-scope since .No [\*[doc-Xr-font]gs\fP] Ns Xr tty II don't apply to it, but it explicitly cannot be placed in raw mode (it's unclear how that would happen), .Sy quit is generated with the "alt mode" key, it's always in .Sy iuclc Pq Li 004 mode, and "a carriage return is echoed when a line-feed is typed" \(em this doesn't appear to be a documented .Xr stty II Ns able mode, and doesn't appear to have survived as a modern one either. .Pp \*[doc-Xr-font]type\fP(I), or .Bl -tag -compact -offset 4n -width ".Li DESCRIPTION" .It Li NAME .Li "type -- type on 2741" .El "produces output on an IBM 2741 terminal with a Correspondence type ball."\& on .Pa /dev/tty5 for reasons too murky to be understood outside of its geographical context and usage procedure from hell. Indeed, the .Sx BUGS say: "The best thing would be to support 2741's as a standard terminal.". .Pp Of interest is also the .Xr hup I (ibid., p. 63) program, which "hangs up the phone on the typewriter which uses it", much like .Nm Sy 0 would, but, per .Sx BUGS , "should not be used; sometimes causes the typewriter channel to be lost". . .Ss UNIX Programmer's Manual, 2\s-4\und\d\s0 Edition The argument names are aligned with the .Tn DC11 manual in .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D June 12, 1972 .%N Second Edition .%O \*[doc-Xr-font]stty\fP(II) .%P pp. 166-167 .%Q Bell Telephone Laboratories, Inc. .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v2/v2man.pdf .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v2/\:v2man.pdf .Re .Ar dcrsr becomes "the typewriter's receiver control and status register" and .Ar dcpsr \(em "transmitter control and status register". .Pp The .Oo Sy \- Oc Ns Sy parodd and .Sy iuclc equivalents are clarified: .Bd -literal -compact 200 even parity allowed on input (e. g. for m37s) 100 odd parity allowed on input 004 map upper case to lower on input (e. g. M33) .Ed .Sy echo is inverted to match present-day: .Bd -literal -compact 010 echo (full duplex) .Ed .Sy icrnl onlcr is reversed: .Bd -literal -compact 020 map CR into LF; echo LF or CR as LF-CR .Ed and new modes appear in the bottom bits: .Bd -literal -compact 002 echo and print tabs as spaces 001 inhibit all function delays (e. g. CRTs) .Ed where .Li 001 is ideologically equivalent to .Sy nl0 cr0 tab0 ff0 .\" cf. V2 tty0(IV) para. 5 and .Li 002 to .Sy tab3 if set and .Sy tab Ns Oo Sy 12 Oc Ns / Ns Sy tab0 if clear/clear but .Li 001 . .Pp The reasoning for .Li 020 .Pq Sy icrnl onlcr is expanded past the .Tn TermiNet Ns s , to "other teminals without the new-line function" \(em i.e. ones for which a newline doesn't return the carriage. .Pp The top byte of the .Ar mode is "used to indicate that the terminal is an IBM 2741 and to specify 2741 modes.": .Bd -literal -compact 400 terminal is an IBM 2741 1000 the 2741 has the transmit interrupt feature (currently ignored) 2000 use correspondence code conversion on output 4000 use correspondence code conversion on input (currently ignored) .Ed .Li 400 also ignores modes .Li 331 and selects proper delays. .Pp The counterpart to the "correspondence code" is the default "EBCDIC (e. g. 963 ball and corresponding keyboard)" \(em since the .Tn 2741 Ns s are .Tn IBM Selectric typewriters, these refer to the two common type balls: the "correspondence" ball (and keyboard) are those of the standard retail .Tn Selectric for office correspondence. It's unclear what .Tn EBCDIC actually means here, since the counterpart to correspondence is PTT/[E]BCD, neither of which even remotely correspond to a character set encoding\(S1. .Pp With this, .Xr type I (ibid., pp. 211-214) becomes .Bl -tag -compact -offset 4n -width ".Li DESCRIPTION" .It Li NAME .Li "type -- type on single sheet paper" .El copying the input files in chunks of .Sy 66 No lines , then waiting for a newline between them to allow manual feeding of loose paper. .Pp .Xr tty0 IV (ibid., pp. 211-214), now with eight devices, now explicitly notes the input buffer of .Sy 150 characters and echoes a .Sy # for each one lost. The newline, tab, and form-feed delays are appropriate for the .Tn Model 37 , but the carriage return delay is appropriate for the .Tn GE TermiNet 300 . The speeds now listed are also .Sy 110 and .Sy 600 , which implies heterogeneity in the devices used since any given .Tn DC11 is capable of being on-line programmable for one set of four speeds, but this is excluded by the .Va SPEED SELECT fields being hard-coded for autodetection. .Pp .Tn ASCII EOT, which causes the .Tn Model 37 to hang up, is stripped from the output (previously it was sent with wrong parity). No mention is made of formerly-similar special processing for NAK, which would lock the keyboard. .Pp Arrangements for the .Tn 2741 (and other supported teletypes) are made automatically with the new \*[doc-Xr-font]getty\fP(VII) (ibid., pp. 251-252) as .Sy cs7 \-cstopb \-echo 134.5 . .Sy echo is off because .Tn 2741 is half-duplex (transmission-wise; all characters typed are always .Pf hardware- Sy echo Ns ed , much like on a typewriter, which it is), and incoming data excludes the keyboard being unlocked. Indeed, the keyboard is only unlocked when a read is being performed, .Sy intr is done by catching a BREAK from the .Li ATTN key, .Sy quit and .Sy eof are impossible, the encoding conversion renders swathes of important punctuation missing and even more of the commonly-used .Tn ASCII plane with entirely unrelated characters. It's astonishing this doesn't simply render the .Tn 2741 unfit for purpose, but letter-quality prints may well have made it just about worth it \(em .Rs .%A Joe Morris .%A Dennis Ritchie .%D 1998-09-03/04 .%J alt.folklore.computers .%T IBM Selectric parallel/serial interface .\" https://groups.google.com/g/alt.folklore.computers/c/M7H9LZrK894/m/-ncoZ9gVzPAJ .%U https://groups.google.com/\:g/alt.folklore.computers/c/\:M7H9LZrK894/m/-ncoZ9gVzPAJ .\" https://groups.google.com/g/alt.folklore.computers/c/M7H9LZrK894/m/zqHmiGrbqh4J .%U https://groups.google.com/\:g/alt.folklore.computers/c/\:M7H9LZrK894/m/zqHmiGrbqh4J .Re .Pp Login processing and rudimentary .Sy 150 Ns -baud Ns / Ns Sy 300 Ns -baud detection in \*[doc-Xr-font]/etc/init\fP (VII) is delegated to the new \*[doc-Xr-font]getty\fP(VII), executed after the call is established: the speed selection is generalised slightly, in that the .Qq Li login:\& message at .Sy 150 baud is prefixed with .\" unix72 .Sq Li \e033:\ea to put the .Tn Model 37 in full-duplex mode; at .Sy 300 baud \(em with .Sq Li \e033;\& to do the same for the .Tn GE TermiNet 300 ; this "is acceptable for other 300 baud terminals also."; at .Sy 134.5 \(em with nothing, see above. .Pp The username is read in raw mode .Pq with standard Sy erase No and Sy kill No processing emulated with either parity allowed, which allows the next speed to be picked and the message re-printed when a zero byte is read (as part of a BREAK). At .Sy 150 baud, the .Tn 2741 Ns 's .Pq Sy 134.5 Ns -baud .ie n .ds down (\fI .el .ds down \d .ie n .ds up \fP) .el .ds up \u .Li ATTN and enter "looks like the ascii \(Fc~\(Fo (174\*[down]8\*[up])" .Pq actually 176\*[down]8\*[up] ; No 174\*[down]8\*[up] is also recognised but it's Qq Sy \&| and, if any of these is read, the .Sy 134.5 Ns -baud speed will be picked immediately (it is noted, however (\*[doc-Xr-font]login, logout\fP(VII) (ibid., pp. 257-258)), that: "If the greeting doesn't appear after a few seconds, hang up and try again; something has gone wrong."). The "speed" here is loose, and includes model-specific flags .Pq parity , Tn 2741 Ns ness . .Pp If the username is terminated with a carriage return instead of a newline, the .Pf post- Nm getty mode will also have .Li 020 .Pq Sy icrnl onlcr set. If it didn't have any lowercase characters, it's mapped to lowercase and .Li 004 .Pq Sy iuclc is set as well. .Pp Following this, it executes the also-new \*[doc-Xr-font]login\fP(I) (ibid., p. 86), or .Bl -tag -compact -offset 4n -width ".Li DESCRIPTION" .It Li NAME .Li "login -- sign onto UNIX" .El with the acquired username, and logging in proceeds as-expected (the passphrase is prompted for .Sy \-echo (if possible, i.e. not on the .Tn 2741 ) , the UID and working directory changed, the MOTD read and .Pa mailbox existence noted, the shell executed). .Pp .Nm hup disappears, but \*[doc-Xr-font]stty\fP(I) (ibid., p. 117) .Em a Ns ppears , and bears recalling in its entirety: .Bl -tag -compact -offset 4n -width ".Li DESCRIPTION\ \ \ \ " .It Li NAME .Li "stty -- set teletype options" .sp .It Li SYNOPSIS .Li "\z\(uls\z\(ult\z\(ult\z\(uly option\d1\u ..." .sp .It Li DESCRIPTION .\" Would love to just have it in literal compact \*[doc-Li-font]\z\(ulS\z\(ult\z\(ult\z\(uly will set certain I/O options on the current output teletype. The option strings are selected from the following set:\fP .sp .Bd -literal -compact \z\(ule\z\(ulv\z\(ule\z\(uln allow even parity. \z\(ul\-\z\(ule\z\(ulv\z\(ule\z\(uln disallow even parity. \z\(ulo\z\(uld\z\(uld allow odd parity \z\(ul\-\z\(ulo\z\(uld\z\(uld disallow odd parity \z\(ulr\z\(ula\z\(ulw raw input (no erase/kill) \z\(ul\-\z\(ulc\z\(ula\z\(uln\z\(ulo\z\(uln " \z\(ul\-\z\(ulr\z\(ula\z\(ulw negate raw mode (erase/kill) \z\(ulc\z\(ula\z\(uln\z\(ulo\z\(uln " \z\(ulc\z\(ulr allow (and echo) cr for lf. \z\(ul\-\z\(uln\z\(ull " \z\(uln\z\(ull negate cr mode. \z\(ul\-\z\(ulc\z\(ulr " \z\(ule\z\(ulc\z\(ulh\z\(ulo echo back every character typed. \z\(ulf\z\(ulu\z\(ull\z\(ull " \z\(ul\-\z\(ulh\z\(ula\z\(ull\z\(ulf " \z\(ulh\z\(ula\z\(ull\z\(ulf do not echo caracters as typed. \z\(ul\-\z\(ule\z\(ulc\z\(ulh\z\(ulo " \z\(ul\-\z\(ulf\z\(ulu\z\(ull\z\(ull " \z\(ull\z\(ulc\z\(ula\z\(uls\z\(ule map upper case to lower case \z\(ul\-\z\(ulu\z\(ulc\z\(ula\z\(uls\z\(ule " \z\(ulu\z\(ulc\z\(ula\z\(uls\z\(ule do not map case \z\(ul\-\z\(ull\z\(ulc\z\(ula\z\(uls\z\(ule " \z\(uls\z\(ulp\z\(ula\z\(ulc\z\(ule map tabs into spaces \z\(ul\-\z\(ult\z\(ula\z\(ulb " \z\(ult\z\(ula\z\(ulb do not map tabs \z\(ul\-\z\(uls\z\(ulp\z\(ula\z\(ulc\z\(ule " \z\(uld\z\(ule\z\(ull\z\(ula\z\(uly calculate cr and tab delays. \z\(ul\-\z\(uld\z\(ule\z\(ull\z\(ula\z\(uly no cr/tab delays \z\(ule\z\(ulb\z\(ulc\z\(uld\z\(uli\z\(ulc ebcdic ball conversion (2741 only) \z\(ul\-\z\(ulc\z\(ulo\z\(ulr\z\(ulr\z\(ule\z\(uls " \z\(ulc\z\(ulo\z\(ulr\z\(ulr\z\(ule\z\(uls correspondence ball conversion (2741 only) \z\(ul\-\z\(ule\z\(ulb\z\(ulc\z\(uld\z\(uli\z\(ulc " .Ed .sp .It Li FILES .Li "standard output.\&" .sp .It Li SEE ALSO .Li "stty(II)" .sp .It Li DIAGNOSTICS .Li \&"Bad options" .sp .It Li BUGS .Li -- .sp .It Li OWNER .Li jfo .El .Pp These map trivially to the .Xr stty II .Ar mode argument. Of these, .Oo Sy \- Oc Ns Sy echo , .Oo Sy \- Oc Ns Sy raw , .Oo Sy \- Oc Ns Sy lcase , and .Oo Sy \- Oc Ns Sy nl survive semantically equivalent, .Oo Li \z\(ul\- Oc Ns Li \z\(ulc\z\(ula\z\(uln\z\(ulo\z\(uln as .Oo Sy \- Oc Ns Sy icanon , .Oo Li \z\(ul\- Oc Ns Li \z\(ult\z\(ula\z\(ulb similarly to .Oo Sy \- Oc Ns Sy tabs , and .Oo Li \z\(ul\- Oc Ns Li \z\(ule\z\(ulv\z\(ule\z\(uln .Oo Li \z\(ul\- Oc Ns Li \z\(ulo\z\(uld\z\(uld similarly to .Oo Sy \- Oc Ns Sy evenp .Oo Sy \- Oc Ns Sy oddp . . .Ss UNIX Programmer's Manual, 2\s-4\und\d\s0 Edition, add'l bibliog.\& \(S1: .br Three keyboards/line codes/type balls for the .Tn 2741 are the "Standard Selectric\d\(rg\u Typewriter" (correspondence), "PTTC/BCD", and "PTTC/EBCD" \(em .Rs .%C 112 East Post Road, White Plains, N.Y. 10601 .%N Third Edition .%P figs. 5-10, pp. 15-20 .%Q International Business Machines Corporation, Data Processign Division .%R TP-09 A24-3415-2 .%T IBM 2741 Communications Terminal .\" http://bitsavers.org/pdf/ibm/2741/A24-3415-2_2741_Communication_Terminal.pdf .%U http://bitsavers.org/\:pdf/\:ibm/\:2741/\:A24-3415-2_2741_Communication_Terminal.pdf .Re .br The line is stateful for the ball hemisphere selected (lower case/upper case headings in even-numbered fig. ibid.) et al., with the sent/received codes corresponding to the rotation and tilt of the ball: .Li BA1 and .Li C42 are: .Sy g Ns / Ns Sy G and .Sy 6 Ns / Ns Sy \(ct for the correspondence models, .Sy a Ns / Ns Sy A and .Sy 6 Ns / Ns Brq Sy \&' No for the standard charset , Sy \&: No for the Tn A No and Tn H No ones, and Sy \(ct No for the typewriter(?) one for the PTTC/BCD ones, and .Sy a Ns / Ns Sy A and .Sy 6 Ns / Ns Sy \&' for the PTTC/EBCD ones. Trivially, since .Tn EBCDIC (or anything contemporary) isn't stateful, none of these are any given encoding. . .Ss UNIX Programmer's Manual, 3\s-4\urd\d\s0 Edition The three substantive changes herein are the correction of the .Li 200 mode description to "M37s" and removal of the "It is all too easy to turn off your typewriter."\& warning from .Sx BUGS in .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D February, 1973 .%N Third Edition .%O \*[doc-Xr-font]stty\fP(II) .%P \*[doc-Pa-font]./man2/stty.2\fP .%Q Bell Telephone Laboratories, Inc. .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v3/v3man.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v3/\:v3man.tar.gz .Re .Pp As well as a drastic culling of modes allowed in \*[doc-Xr-font]stty\fP(I) .Pq ibid., Pa ./man1/stty.1 , now: .Bd -literal -compact \z\(ule\z\(ulv\z\(ule\z\(uln allow even parity. \z\(ul\-\z\(ule\z\(ulv\z\(ule\z\(uln disallow even parity. \z\(ulo\z\(uld\z\(uld allow odd parity \z\(ul\-\z\(ulo\z\(uld\z\(uld disallow odd parity \z\(ulr\z\(ula\z\(ulw raw mode input (no erase/kill/interrupt/quit/EOT) \z\(ul\-\z\(ulr\z\(ula\z\(ulw negate raw mode \z\(ul\-\z\(uln\z\(ull allow cr for lf (and echo lf cr) \z\(uln\z\(ull allow nl only \z\(ule\z\(ulc\z\(ulh\z\(ulo echo back every character typed. \z\(ul\-\z\(ule\z\(ulc\z\(ulh\z\(ulo do not echo characters. \z\(ull\z\(ulc\z\(ula\z\(uls\z\(ule map upper case to lower case \z\(ul\-\z\(ull\z\(ulc\z\(ula\z\(uls\z\(ule do not map case \z\(ul\-\z\(ult\z\(ula\z\(ulb\z\(uls replace tabs by spaces \z\(ult\z\(ula\z\(ulb\z\(uls preserve tabs \z\(uld\z\(ule\z\(ull\z\(ula\z\(uly calculate cr and tab delays. \z\(ul\-\z\(uld\z\(ule\z\(ull\z\(ula\z\(uly no cr/tab delays \z\(ule\z\(ulb\z\(ulc\z\(uld\z\(uli\z\(ulc ebcdic ball conversion (2741 only) \z\(ulc\z\(ulo\z\(ulr\z\(ulr\z\(ule\z\(uls correspondence ball conversion (2741 only) .Ed i.e.\& .Oo Li \z\(ul\- Oc Ns Li \z\(ult\z\(ula\z\(ulb becoming the present-day-spelling of .Oo Sy \- Oc Ns Sy tabs and the redundant .Oo Li \z\(ul\- Oc Ns Li \z\(ulc\z\(ula\z\(uln\z\(ulo\z\(uln , .Oo Li \z\(ul\- Oc Ns Li \z\(ulc\z\(ulr , .Oo Li \z\(ul\- Oc Ns Li \z\(ulf\z\(ulu\z\(ull\z\(ull , .Oo Li \z\(ul\- Oc Ns Li \z\(ulh\z\(ula\z\(ull\z\(ulf , .Oo Li \z\(ul\- Oc Ns Li \z\(ulu\z\(ulc\z\(ula\z\(uls\z\(ule , .Oo Li \z\(ul\- Oc Ns Li \z\(uls\z\(ulp\z\(ula\z\(ulc\z\(ule , .Li \z\(ul\-\z\(ule\z\(ulb\z\(ulc\z\(uld\z\(uli\z\(ulc , .Li \z\(ul\-\z\(ulc\z\(ulo\z\(ulr\z\(ulr\z\(ule\z\(uls spellings being removed. . .Ss UNIX Programmer's Manual, 4\s-4\uth\d\s0 Edition Sees a rewrite of the kernel in .Tn C , of the manual in .Xr troff 1 , and is infested by gnomes \(em .\" https://twitter.com/nabijaczleweli/status/1571222355900342278 .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D November, 1973 .%N Fourth Edition .%O How to Get Started, \fILogging in.\fP .%P \*[doc-Pa-font]./man0/basinf\fP .%Q Bell Telephone Laboratories, Inc. .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v4/v4man.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v4/\:v4man.tar.gz .Re .Pp .Xr getty VII .Pq ibid., Pa ./man7/getty.7 cycles between just .Sy 150 Ns - and .Sy 300 Ns -baud and kernel support for the .Tn 2731 is removed entirely, and .Xr type I .Pq ibid., Pa ./man1/type.1 once again becomes .D1 type \- type on 2741 this time copying the input to .Pa /dev/ttyc "converting to 2741 EBCDIC output code."; the usage procedure specifies that while it still reads the teletype, the .Li ATTN key is to be pressed (since the .Tn 2741 can't be .Sy raw and is always .Pf hard- Sy echo , this is the only way to get indicate anything without messing up the letter, assuming the keyboard is even unlocked), and an inscrutable .Sx BUGS section follows; it appears that the .Tn 2741 Ns s were only worth as much hassle as was required to print letters, and no more \(em .Rs .%A Tom Van Vleck .%D 1997-02-17 .%J Multicians .%T Home Terminals .%P para. 10 .\" https://multicians.org/terminals.html .%U https://multicians.org/\:terminals.html .Re .Pp The input buffer is bumped to .Sy 256 bytes .Pq Xr dc IV Pq ibid., Pa ./man4/dc.4 , and overrun characters are "thrown out without notice". .Tn ASCII EOT is only stripped from output if not .Sy raw . .Pp The "upper-case mode" (004) is additionally described as present-day .Sy xcase (with the mapped characters in the same order, even! This (and the already-extant lowercase) directly corresponds to the characters untypeable on a .Tn Teletype Model 33 .Pq and Tn 35 , present on all .Tn DEC PDP-11 Ns s as standard\(S2 ) , but not predicated on .Sy icanon . .Pp Recognisable (but unreliable, so not quite present-day) signals appear as .Xr signal II .Pq ibid., Pa ./man2/signal.2 and hanging up sends signal .Sy 1 .Pq what we'd call Dv SIGHUP , default action terminate without core, to .Em all processes whose .Em control typewriter matches the hanged-up one, then "returns with an end-of-file indication" as previous. This is as present-day. .Pp This courtesy is extended to DEL's "interrupt signal" .Pq Sy 2 , Dv SIGINT and FS' "quit signal" .Pq Sy 3 , Dv SIGQUIT . It's implied that but unclear how the shell protects itself from either signal. .Pp .Xr stty II .Pq ibid., Pa ./man2/stty.2 sees a major rework with a .Sx SYNOPSIS of .Bd -literal -compact -offset 4n \fR(stty = 31.) (file descriptor in r0)\fP \fBsys stty; arg \&... arg: speed; 0; mode stty(fildes, arg) int arg[3];\fP .Ed The "speed and general handling of the input side of the typewriter" .Pq Sy ispeed , No unclear what \&"general handling" means resides in the "low" byte of .Ar speed , and "the speed of the output side" .Pq Sy ospeed \(em the "high" byte. It may therefore make more sense to present .Ar arg as a pointer to a .Li struct \&{ Vt u8 Fa ispeed , ospeed , pad Ns [ Ns Vt 2 ] ; u16 Fa mode ; Li };\& . .Pp The speeds listed are the ones "supported by the DH-11 interface", lifted directly from .Rs .%C Maynard, Massachusetts .%D September 1976 .%N 1st Edition .%P Chapter 3 (Programming), 3.2.3 (Line Parameter Register), p. 3-5 .%Q Digital Equipment Corporation .%R EK-ODH11-OP-002 .%T DH11 asynchronous 16-line multiplexer user's manual .\" http://bitsavers.org/pdf/dec/unibus/EK-ODH11-OP-002_DH11_Asynchronous_16-line_Multiplexer_Users_Manual_Sep76.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:EK-ODH11-OP-\:002_DH11_Asynchronous_\:16-line_Multiplexer_\:Users_Manual_\:Sep76.pdf .Re Which are: .TS l4zw0 n1b l n1b l n1b l n1b l . 0 Zero Baud 4 134.5 Baud 8 600 Baud 12 4800 Baud 1 50 Baud 5 150 Baud 9 1200 Baud 13 9600 Baud 2 75 Baud 6 200 Baud 10 1800 Baud 14 External Input A 3 110 Baud 7 300 Baud 11 2400 Baud 15 External Input B .TE and compare 3.3.5 Zero Baud (ibid., 3-9), which says: "A speed selection of 0 Baud is provided so that the program may turn off any line.". .Pp With two important differences: speed .Sy 0 is defined as "(turn off device)", and speeds .Sy 14 and .Sy 15 are defined as "External A" and "External B". This has made a lot of people very angry and been widely regarded as a bad move. .Pp The attentive reader may notice that the speeds are listed for an entirely different device \(en a .Tn DH11 incessantly called a "DH-11" \(en than supposedly has a manual page and supposedly contains the .Pa /dev/tty?\& device family \(en .Xr dc IV : .Tn DC11 (likewise, "DC-11"). Indeed, the reference implementation of the .Tn UNIX system has just "DC-11 interfaces actually present", but the PREFACE states (\c .%B Fourth Edition , .Pa ./man0/intro ) : .Bd -filled -compact -offset 4n The number of .Tn UNIX installations is now above 20, and many more are expected. None of these has exactly the same complement of hardware or software. .Ed .Pp The manual lists asterisks after the speeds supported by its .Tn DC11 Ns s .Pq unwaveringly Sy 134.5 , 150 , 300 , 1200 , warning that "if a non-starred speed is selected, it will be ignored and the present speed left unchanged.". Even further: .Bd -filled -compact -offset 4n In the current configuration, only 150 and 300 baud are really supported, in that the code conversion and line control required for 2741's (134.5 baud) must be implemented by the user's program, and the half-duplex line discipline required for the 202 dataset (1200 baud) is not supplied. .Ed .Pp One could say that this is a primordial version of .Pf inter- Tn UNIX portability, like the outsourcing of mounting of .Pa /usr .Pq and Pa /sys , changing the mode of the .Tn DECtape nodes and spawning .Xr dpd VII .Pq ibid., Pa ./man7/dpd.7 from the .Xr init VII process itself to the new-in-\c .%B Fourth Edition .Pa /etc/rc . Or, given that .Xr getty VII still uses a fixed table of remote teletype types and .Xr init VII \(em of local teletype lines to wait on, one could be reaching. .Pp Beyond removal of the .Tn 2741 .Li 400 , 1000 , 2000 modes, .Li 020 is re-described to echo "as CR-LF" despite a subsequent paragraph describing it and .Xr dc IV remaining unchanged as "LF-CR", and a new mode: .\" original indent not represented (because i gave up) .TS l4zw0 l l . 10000 no delays after tabs (e.g. TN 300) .TE which seems best-matched to .Sy tab0 ; it's unclear if 001 implies 10000, and likely that 002 .Pq Sy tab3 overrides it by removing tabs from the output entirely. .Pp The console teletype .Xr kl IV .Po ibid., Pa ./man4/kl.4 Pc Ns 's "line disciplines" .Qq are identical to those for Pa tty?\& , and it accepts .Xr gtty II Ns / Ns Xr stty II , with the only "salient differences" being the different key for .Dv SIGQUIT and that "the speed-select word is ignored". One could say that the latter isn't a difference, since that's the behaviour for most speeds on .Xr dc IV , but. .Pp .Xr stty I .Po ibid., Pa ./man1/stty.1 Pc Ns 's .Sy raw parenthetical gains "parity bit passed back"(?), .Sy \-nl also turns around as "CR-LF" to match the syscall, .Oo Sy \- Oc Ns Sy delay also mentions form-feed (no functional change, presumably? given that form feed is mentioned in the .%B Second Edition as well), and .Li \z\(ule\z\(ulb\z\(ulc\z\(uld\z\(uli\z\(ulc .Li \z\(ulc\z\(ulo\z\(ulr\z\(ulr\z\(ule\z\(uls are replaced with .TS l4zw0 lb l . tdelay calculate tab delays \-tdelay no tab delays .TE .Pp The .Sx BUGS section becomes .Bd -filled -compact -offset 4n There should be 'package' options such as \fBexecuport,\fP \fB33,\fP or \fBterminet.\fP .Ed . .Ss UNIX Programmer's Manual, 4\s-4\uth\d\s0 Edition, add'l bibliog.\& \(S2: .br .Rs .%C Maynard, Massachusetts .%D September 1970 .%N 3rd Printing .%P Chapter 2 (General Description), 2.1 Introduction, para. 2 .%Q Digital Equipment Corporation .%R DEC-11-HR4C-D .%T KL11 teletype control manual .\" http://bitsavers.org/pdf/dec/unibus/KL11_TeletypeControlManual.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:KL11_TeletypeControlManual.pdf .Re .Pp .Rs .%C Maynard, Massachusetts .%D September 1970 .%N 5th Printing .%P Chapter 4 (Installation), LT33 Teletype, LT35 Teletype, pp. 4-7, 4-8 .%Q Digital Equipment Corporation .%R DEC-11-HR5B-D .%T H720 power supply and mounting box manual .\" http://bitsavers.org/pdf/dec/pdp11/pwrSupply/H720_PowerSupplyMan.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:pdp11/\:pwrSupply/H720_PowerSupplyMan.pdf .Re As well as ibid., Table 4-1 (PDP-11 System Configurations), p. 4-1. .Pp .Rs .%C 555 Touhy Avenue, Skokie, Illinois .%D 1962, 1963 .%P Section 7 (Principles of Operation), 7-2. Code, Fig. 7-1.a. (Character Arrangement) .%Q Teletype Corporation .%R Bulletin 273B .%T Technical Manual, Model 32 and 33 .\" http://bitsavers.org/communications/teletype/33/273B_Mod32_33_TechMan_Jan63.pdf .%U http://bitsavers.org/\:communications/\:teletype/\:33/\:273B_Mod32_33_TechMan_Jan63.pdf .Re .Pp The .Tn Model 35 has a Shift key, so it could be used to type lower-case letters, but it inverts bit 5, so it can't be used to type special characters from .Sy xcase : .Rs .%C 555 Touhy Avenue, Skokie, Illinois .%D 1962, 1964, 1965 .%P Section 2 (Principles of Operation), 2.20 (Shift Key Mechanism), p. 12 .%Q Teletype Corporation .%R Bulletin 221B, Section 574-221-100 .%T 35 Keyboard and Base for Keyboard Send-Receive (KSR) and Receive-Only (RO) Teletypewriter Sets, Description and Operation .\" http://bitsavers.org/communications/teletype/35/281B_Mod35_TechVol1_Apr73.pdf .%U http://bitsavers.org/\:communications/\:teletype/\:35/\:281B_Mod35_TechVol1_Apr73.pdf .%V Volume 1 .Re .br It can't print lower-case characters: .Rs .%C 555 Touhy Avenue, Skokie, Illinois .%D 1963 .%P Section 2 (Principles of Operation), 2.04 (Signaling Code), Fig. 5, p. 9 .%Q Teletype Corporation .%R Bulletin 221B, Section 574-220-100 .%T 35 Typing Unit, General Description and Principles of Operation .\" http://bitsavers.org/communications/teletype/35/281B_Mod35_TechVol1_Apr73.pdf .%U http://bitsavers.org/\:communications/\:teletype/\:35/\:281B_Mod35_TechVol1_Apr73.pdf .%V Volume 1 .Re . .Ss UNIX Programmer's Manual, 5\s-4\uth\d\s0 Edition .Sy 300 Ns -baud teletypes are now the default \(em .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D June, 1974 .%N Fifth Edition .%O How to Get Started, \fILogging in.\fP .%P p. iv .%Q Bell Telephone Laboratories, Incorporated .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v5/v5man.pdf .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/Dennis_v5/v5man.pdf .Re So the \*[doc-Xr-font]getty\fP (VIII) (ibid., p. 267) speed ordering is reversed to try it first, then fall back to .Sy 150 Ns -baud on BREAK. The .Sy 300 Ns -baud .Qq Li login:\& prefix additionally returns "the GSI terminal to non-graphic mode". .Pp \*[doc-Xr-font]init\fP (VIII) (ibid., p. 268) now reads .Pa /etc/ttys (\*[doc-Xr-font]ttys\fP (V) (ibid., 211)) as a list of lines to listen on and programs to spawn when called (but "the only program currently specifiable is \fI/etc/getty\fP (q.v.).", since the program is an offset into an .Nm init Ns -internal table) and accepts "the \fIhangup\fP signal (signal #1)" .Pq Dv SIGHUP to reload and reprocess it "as in a reboot" \(em remnants of this remain in all present-day .Nm init Ns s . .Pp \*[doc-Xr-font]tty\fP (IV) (ibid., p. 194) is re-instated as a description of all "low-speed asynchronous communications ports", with the hardware-specific peculiarities relegated to their respective \*[doc-Xr-font]dc\fP (IV) (ibid., 180), \*[doc-Xr-font]dh\fP (IV) (ibid., 181), and \*[doc-Xr-font]kl\fP (IV) (ibid., 184) pages, all of which unchanged and equally uninteresting, except to see that the .Tn DC11 .Pa /dev/tty Ns Op Pa 01234567abcd is described as "not currently connected", and appears replaced on the reference implementation by the .Tn DH11 at .Pa /dev/tty Ns Op Pa f Ns Ar - Ns Pa u . The only significant change is that the default speed is also .Sy 300 baud and individual settable speeds are not listed. .Pp The "parity bit passed back" bit is clarified in the .Sy raw paragraph as .Bd -filled -compact -offset 4n The input parity bit is passed back to the reader, but parity is still generated for output characters. .Ed clarification is achieved, but thankfully half of the new .Sx BUGS also make the meaning not a tad clearer: .Bd -filled -compact -offset 4n On raw-mode output, parity should be transmitted as specified in the characters written. .Ed .Pp "If you find it hard to type" FS, "try control-\e or control-shift-L."; the other half of the new .Sx BUGS is that "Half-duplex terminals are not supported." \(em this is supported by the nonexistence of .Nm type . .Pp \*[doc-Xr-font]stty\fP (II) (ibid., p. 131) loses asterisks after "supported speeds" and generalises the unknown-speed \(rA ignored behaviour to all the aforementioned devices for the aforementioned reasons. Besides that, it appears unchanged \(em the \*[doc-Xr-font]dc\fP (IV) speeds are stil listed as if globally true and mode 10000 .Pq Sy tab0 is crossed out by hand entirely, with the description of mode 001 .Pq Sy nl0 cr0 tab0 ff0 crossed out and "hangup on last close" penned in .\" PBUH MrDOS: https://twitter.com/MrDOS/status/1571618666701103104 \(em this is .Oo Sy \- Oc Ns Sy hupcl , with that exact phrasing of the flag surviving to .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 . .Pp It's unclear what this means, especially given that \*[doc-Xr-font]stty\fP (I) (ibid., p. 79) is unchanged entirely. . .Ss UNIX Programmer's Manual, 6\s-4\uth\d\s0 Edition Sees the introduction of .Pa /dev/tty , corresponding to the process's .Em control typewriter (the console is exclusively .Pa /dev/tty8 , a synonym in the .%B Fifth edition ) , as present-day, "a variety of delays after function characters", rather than model-class enumeration for each "function" (NL/CR/tab/FF), speed changes explicitly predicated on "if the hardware permits" \(em .Rs .%A K. Thompson .%A D. M. Ritchie .%B UNIX Programmer's Manual .%D May, 1975 .%N Sixth Edition .%O \*[doc-Xr-font]tty\fP (IV) .%P \*[doc-Pa-font]./man/man4/tty.4\fP .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v6/v6doc.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v6/\:v6doc.tar.gz .Re .Sq Sy # and .Sq Sy @ are "By default", and EOT is finally parenthesised as "control-D". .Pp \*[doc-Xr-font]init\fP (VIII) .Pq ibid., Pa ./man/man8/init.8 always runs .Nm getty , and the third \*[doc-Xr-font]ttys\fP (V) .Pq ibid., Pa ./man/man5/ttys.5 column is instead passed as an argument thereto: .Bd -filled -compact -offset 4n For normal lines, the character is '0'; other characters can be used, for example, with hard-wired terminals where speed recognition is unnecessary or which have special characteristics. (Getty will have to be fixed in such cases.) .Ed .Pp \*[doc-Xr-font]getty\fP (VIII) .Pq ibid., Pa ./man/man8/getty.8 mentions no such modes, simply predicating the description of the former .Sy 300 Ns -/ Ns Sy 150- Ns baud operation on being passed .Sq Sy 0 . However, the .Nm getty of the reference system is available at .Rs .%P \*[doc-Pa-font]./s1/getty.c\fP .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v6/v6src.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v6/\:v6src.tar.gz .Re And reveals: a .Sq Sy - mode for the "Console TTY" whose .Sy 110 icrnl onlcr tab3 iuclc olcuc xcase cr1 point to it continuing to be the same .Tn Model 33 , with an entry in the default table after the .Sy 150 Ns -baud mode. .Pp There's also a .Sq Sy 1 table, which contains only the .Sy 150 Ns -baud entry, and a .Sq Sy 2 one, described only as "9600" \(em .Sy 9600 icrnl onlcr tab3 ff1 . .Pp \*[doc-Xr-font]stty\fP (II) (\c .%B Sixth Edition , .Pa ./man/man2/stty.2 ) finally sees a new .Sx SYNOPSIS : .Bd -literal -compact -offset 4n \fR(stty = 31.) (file descriptor in r0)\fP \fBsys stty; arg \&... arg: .byte ispeed, ospeed; .byte erase, kill; mode stty(fildes, arg) struct { char ispeed, ospeed; char erase, kill; int mode; } *arg;\fP .Ed .Pp The .Fa erase , kill members are self-explanatory. The .Fa mode table is vastly expanded: .TS l4zw0 l l . 100000 Select one of two algorithms for backspace delays 040000 Select one of two algorithms for form-feed and vertical-tab delays 030000 Select one of four algorithms for carriage-return delays 006000 Select one of four algorithms for tab delays 001400 Select one of four algorithms for new-line delays 000200 even parity allowed on input (e. g. for M37s) 000100 odd parity allowed on input 000040 raw mode: wake up on all characters 000020 map CR into LF; echo LF or CR as CR-LF 000010 echo (full duplex) 000004 map upper case to lower on input (e. g. M33) 000002 echo and print tabs as spaces 000001 hang up (remove 'data terminal ready,' lead CD) after last close .TE Which matches the scribble in .%B Fifth Edition . .Pp The delays are very similar to present-day, but described in terms of narrow-bit integers, rather than bit-fields, and form-feed is overloaded with vertical tab, and a zeroed delay value corresponds to no delay for that function byte; respectively, they correspond to: .Dv BSDLY , .Dv FFDLY Ns = Ns Dv VTDLY , .Dv CRDLY , .Dv TABDLY , .Dv NLDLY , and are expounded as follows. .Pp .TS l1b l1b l1b l0 lb r1fCR l1fCR r1b l lx . Value Field Equiv. Description _ 100000 BSDLY\ \fR=\fP\fB1\fP bs1 " currently ignored but will be used for Terminet 300's." 040000 FFDLY\ \fR=\fP\fB1\fP ff1\fR/\fPvt1 " about 2 seconds." 030000 CRDLY\ \fR=\fP\fB3\fP " is unimplemented and is 0." 20000 CRDLY\ \fR=\fP\fB2\fP cr3 " lasts about .16 seconds and is suitable for the VT05 and the TI 700." 10000 CRDLY\ \fR=\fP\fB1\fP cr2 " lasts about .08 seconds and is suitable for the Terminet 300." 006000 TABDLY\fR=\fP\fB3\fP unimplemented, \*[doc-Sy-font]0\fP 4000 TABDLY\fR=\fP\fB2\fP unimplemented, \*[doc-Sy-font]0\fP 2000 TABDLY\fR=\fP\fB1\fP tab1 " T{ dependent on the amount of movement and is tuned to the Teletype model 37." T} 001400 NLDLY\ \fR=\fP\fB3\fP " is unimplemented and is 0." 1000 NLDLY\ \fR=\fP\fB2\fP nl1 " useful for the VT05 and is about .10 seconds." 400 NLDLY\ \fR=\fP\fB1\fP " dependent on the current column and is tuned for Teletype model 37's." .TE .Pp Mode 000001 corresponds directly to .Oo Sy \- Oc Ns Sy hupcl , and "is useful when a port is to be used for some special purpose; for example, if it is associated with ACU used to place outgoing calls.", with "ACU" presumably standing in for an Automatic Calling Unit. .Pp \*[doc-Xr-font]stty\fP (II) is "also used with certain special files other than typewriters" \(em it's the only non-I/O entry in the device driver interfaces, cf.\& .Rs .%A Dennis M. Ritchie .%B The Unix I/O System .%O \*[doc-Pa-font]./iosys/iosys\fP .%P \fBCharacter device drivers\fP .%Q Bell Telephone Laboratories .\" https://www.tuhs.org/Archive/Distributions/Research/Dennis_v6/v6doc.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Dennis_v6/\:v6doc.tar.gz .Re And compare .%B v6src.tar.gz .Pa ./usr/sys/conf.h .Va bdevsw Ns / Ns Va cdevsw \(em "but since none of them are part of the standard system the specifications will not be given."; one could consider this a primordial .Xr ioctl 2 . .Pp \*[doc-Xr-font]stty\fP (I) (\c .%B Sixth Edition , .Pa ./man/man1/stty.1 ) allows no arguments, in which case it "reports the current settings of the options", much like present-day, The .Qq Oo Sy \- Oc Ns Sy delay and .Qq Oo Sy \- Oc Ns Sy tdelay .Ar option Ns s are removed in favour of: .TS l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb l l4zw0 lb s l4zw0 lb lx . cooked same as '\-raw' and ek reset erase and kill characters back to normal # and @. erase\fI c\fP set erase character to \fIc.\fP kill\fI c\fP set kill character to \fIc.\fP cr0 cr1 cr2 cr3 select style of delay for carriage return (see below) nl0 nl1 nl2 nl3 select style of delay for linefeed (see below) tab0 tab1 tab2 tab3 select style of delay for tab (see below) ff0 ff1 select style of delay for form feed (see below) tty33 set all modes suitable for Teletype model 33 tty37 set all modes suitable for Teletype model 37 vt05 set all modes suitable for DEC VT05 terminal tn300 set all modes suitable for GE Terminet 300 ti700 set all modes suitable for Texas Instruments 700 terminal tek set all modes suitable for Tektronix 4014 terminal hup hang up dataphone on last close. \-hup do not hang up dataphone on last close. 0 hang up phone line immediately 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta extb T{ Set typewriter baud rate to the number given, if possible. (These are the speeds supported by the DH-11 interface). T} .TE It should come as no surprise that "(see below)" points to nothing, except to clarify that "various delay algorithms are tuned to varous kinds of terminals", and reiterating that the .Sy 0 Ns -terminated options mean no delay. .Pp Of these, .Sy cooked , .Oo Sy \- Oc Ns Sy hup , and the speeds are retained verbatim .Pq but see Sx STANDARDS , Line Speed , .Sy ek using a system default .Pq Dv CERASE , CKILL , and .Sy erase kill are equivalent for the .Ar cc Ns -is-single-byte case. .Pp .%B v6src.tar.gz .Pa ./s2/stty.c reveals that there are .Oo Sy \- Oc Ns Sy LCASE , aliases for .Oo Sy \- Oc Ns Sy lcase , as present-day, a .Sy 134 alias for .Sy 134.5 , .Sy 33 37 05 tn ti aliases for .Sy tty33 tty37 vt05 tn300 ti700 , respectively, which replace delay flags with .Sy cr1 , ff1 cr2 tab1 nl1 , nl2 , cr1 , cr2 , ff1 , respectively. The .Sy bs Ns Op Sy 01 delays, conspicuously missing from the manual, are there, but just conspicuously missing from the manual. .Pp The no-argument output is ideologically much like present-day .Sy sane , deviations except much less formalised (and written to the standard error stream): the first lines are either .Bd -literal -compact -offset 4n .Li input speed\ Ar ispeed Li baud .Li output speed Ar ospeed Li baud .Ed or .Bd -literal -compact -offset 4n .Li speed Ar speed Li baud .Ed where the .Ar speed is an integer .Pq i.e. Sy 134.5 No is truncated , and .Sy 0 for .Sy exta extb . The observant reader will notice that there's no way to set differing speeds with .Nm stty . It's unclear if they were used at all, at least on interactive lines. A line of .Bd -literal -compact -offset 4n .Li erase = ' Ns Ar cc Ns Li '; kill = ' Ns Ar cc Ns Li ' .Ed follows (these are unescaped and written verbatim), then a listing of the modes set as: .TS l4zw0 n2fCR lb . 0200 even 0100 odd 040 raw 020 \-nl 010 echo 04 lcase 02 \-tabs 01 hup .TE followed by the .Pf non- Sy 0 delays .Pq Sy nl , tab , cr , ff , bs , separated by spaces, as the final line. . .Ss UNIX Programmer's Manual, 7\s-4\uth\d\s0 Edition Many more and different models are listed, as expected from four years of increasingly affordable cash cows being bred; the .ft I .Tn TTY 37 terminal .ft P section is generalised as \fI1200- and 150-baud terminals\fP to cover causing BREAKs until the correct speed is achieved, and a new \fIHard-wired terminals\fP section appears, saying that they "usually begin at the right speed, up to 9600 baud", and defers to the normal instructions otherwise \(em .Rs .%B UNIX\(tm Time-Sharing System: UNIX Programmer's Manual .%D January, 1979 .%N Seventh Edition .%O Introduction to Volume 1, How to Get Started, \fILogging in.\fP .%P \*[doc-Pa-font]usr/\:man/\:man0/\:intro\fP .%Q Bell Telephone Laboratories, Incorporated .\" https://www.tuhs.org/Archive/Distributions/Research/Henry_Spencer_v7/v7.tar.gz .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Research/\:Henry_Spencer_v7/\:v7.tar.gz .%V Volume 1 .Re .Pp The "'break' or 'interrupt' key" \(em the one that generates the BREAK used to cycle between speeds \(em sends .Dv SIGINT , with the usual DEL method seemingly being second-class (ibid., \fIHow to communicate through your terminal.\fP, para. 4). .Pp As for \fIStty and gtty\fP, "These system calls have been extensively altered, see \fIioctl\fP(2) and \fItty\fP(4)." (ibid., Converting From the 6th Edition). .Pp Indeed, they're now described in the new .Xr ioctl 2 .Pq ibid., Pa usr/man/man2/ioctl.2 as shims for .Nm ioctl Ns Pq Dv TIO Ns Oo Dv GS Oc Ns Dv ETP , and are provided as such by .Lb libc ; the formerly-\*[doc-Xr-font]stty\fP (II) information is merged into .Xr tty 4 .Pq ibid., Pa usr/man/man4/tty.4 , though it's now about "terminals", rather than "typewriters". The individual-device pages are shed, as are references thereto. .Pp "The set of processes that thus share a control terminal is called a \fIprocess group\fP" \(em this has no bearing on the actual semantics of the system, and process groups are acquired (and shed) differently in present-day, but this is the first notion of the process group \(em .Xr kill 2 .Pq ibid., Pa usr/man/man2/kill.2 , when signalling pid .Ar 0 , signals the members of the caller's process group: .Em this is as present-day. .Pp The argument format is the same, but now defined in .In sgtty.h , designated .Vt "struct sgttyb" , with members prefixed with .Fa sg_ , and .Fa mode \(em .Fa sg_flags . The speeds themselves are defined with their present-day .Dv B Ns Ar intspeed , .Dv EXTA , .Dv EXTB macros. .Pp The .Dv TIOCSETN .Fn ioctl is like .Dv TIOCSETP , but doesn't wait for output empty then dump input buffer. Mode 000001 .Pq Dv HUPCL is moved to .Nm ioctl Ns Pq Dv TIOCHPCL (description retained), and becomes .Qq Dv TANDEM . .Pp The delay mask macros appear .Pq humorously , with Qo Dv VTDELAY Qc governing Dv FF Ns Op Dv 01 , and .Qq Dv XTABS becomes the third tab delay mode .Pq present-day Dv TAB3 . Backspace delays are downgraded to "might". .Pp Besides those, the low-order byte bit layout is the same: .TS l4zw0 lfCR nb l . EVENP 0000200 Even parity allowed on input (most terminals) ODDP 0000100 Odd parity allowed on input RAW 0000040 Raw mode: wake up on all characters, 8-bit interface CRMOD 0000020 Map CR into LF; echo LF or CR as CR-LF ECHO 0000010 Echo (full duplex) LCASE 0000004 Map upper case to lower on input CBREAK 0000002 Return each character as soon as typed TANDEM 0000001 Automatic flow control .TE Of these, .Dv ECHO survives as a macro today and .Dv TANDEM as .Sy ixoff with an alias. .Pp Raw mode is extended with .Bd -filled -compact -offset 4n There are no delays and no echoing, and no replacement of one character for another; characters are a full 8 bits for both input and output (parity is up to the program). .Ed It's unclear what this means. .Pp The new .Qq Dv CBREAK mode is described as .Bd -filled -compact -offset 4n CBREAK is a sort of half-cooked (rare?) mode. Programs can read each character as soon as typed, instead of waiting for a full line, but quit and interrupt work, and output delays, case-translation, CRMOD, XTABS, ECHO, and parity work normally. On the other hand there is no erase or kill, and no special treatment of \e or EOT. .Ed It's unclear what this means. Well, it's clear what it means, but unclear why \(em a reasonable guess would be, upon reflection on the modern .Oo Sy \- Oc Ns Sy cbreak alias, a lack of sufficient fragmentation \(em the contemporary driver had all of eight bits without delays, modern ones barely make do with .Em 120 . .Pp The .Dv TIOC Ns Oo Dv GS Oc Ns Dv ETC .Pq misdocumented as Dv TIOCSETC Ns " and" Dv TIOCSETP Ns " again" .Fn ioctl Ns s , allows changing the "special characters", with defaults outlined below, via the following .In sgtty.> type: .\" Original tabs! .Bd -literal -compact -offset 4n .ft B struct tchars { char t_intrc; /* interrupt */ char t_quitc; /* quit */ char t_startc; /* start output */ char t_stopc; /* stop output */ char t_eofc; /* end-of-file */ char t_brkc; /* input delimiter (like nl) */ }; .ft P .Ed .Pp .TS lb lb lb lb l lb . Character \*[doc-Tn-font-size]ASCII\s0 Default Printable Default _ intr DEL ^? quit FS ^\*[doc-Ar-font]\e\fP start DC1 ^\*[doc-Ar-font]Q\fP stop DC3 ^\*[doc-Ar-font]S\fP eof EOT ^\*[doc-Ar-font]D\fP eol \*[doc-Li-font]^-\fP .TE These all match present-day defaults. .Pp Indeed \(em this is the first system with truly settable .Sx Special Control Characters and it includes a disabling functionality, though spelled as .Sy \-1 .Pq rather than today's Dv _POSIX_VDISABLE . .Pp .Sy start and .Sy stop are fully formed (in .Sy ixany mode). .Pp .Sy eol is fully formed: .Bd -filled -compact -offset 4n The \fIt_brkc\fP character, by default \-1, acts like a new-line in that it terminates a 'line,' is echoed, and is passed to the program. The 'stop' and 'start' characters may be the same, to produce a toggle effect. It is probably counterproductive to make other special characters (including erase an kill) identical. .Ed .Pp The new .Qq Dv TANDEM mode sends .Fa t_stopc Ns / Ns Fa t_startc in response to the input buffer water level: "It is useful for flow control when the 'terminal' is actually another machine that obeys the conventions.". The name hints that this was intended for talking with Tandem Computers, Inc.\& systems, presumably; it's not used in the userland of the distribution tape at all. .Pp The .Sx BUGS lose the "parity should be transmitted" sentence and gain an even more indicting paragraph: .Bd -filled -compact -offset 4n The terminal handler has clearly entered the race for ever-greater complexity and generality. It's still not complex and general enough for TENEX fans. .Ed .\" The "on first open, the default mode is" sentence is also lost, but by god. who cares. .Pp .Xr init 8 .Pq ibid., Pa usr/man/man8/init.8 , rather than checking the console switches, just starts .Nm /bin/sh Li < Ns Pa /dev/console .Pq the latter replaced Pa tty8 , and boots multi-user when the shell exits; as expected, .Dv SIGHUP restarts the .Nm init sequence at single-user mode. .Pp .Xr getty 8 .Pq ibid., Pa usr/man/man8/getty.8 is generalised to say that the "login:" message "can contain character sequences to put various kinds of terminals in useful states." and enumerates the following .Xr ttys 5 second-column values: .TS l4zw0 l2b lx . 0 T{ Cycles through 300-1200-150-110 baud. Useful as a default for dialup lines accessed by a variety of terminals. T} - Intended for an on-line Teletype model 33, for example an operator's console. 1 Optimized for a 150-baud Teletype model 37. 2 Intended for an on-line 9600-baud terminal, for example the Textronix 4104. 3 T{ Starts at 1200 baud, cycles to 300 and back. Useful with 212 datasets where most terminals run at 1200 speed. T} 5 Same as '3' but starts at 300. 4 Useful for on-line console DECwriter (LA36). .TE Which do not exhaust the actual tables available. .Pp .Sx Special Control Characters are reset to their defaults together with setting the initial username-asking mode. .Pp .Xr stty 1 .Pq ibid., Pa usr/man/man1/stty.1 lists .Sy bs Ns Op Sy 01 in the manual, replacing the ominous "(see below)"s on all delay modes and "various delay algorithms" note with a "(see \fIioctl\fP(2))" on the first .Pq Sy cr , adds .TS l4zw0 lb l . cbreak make each character available to \fIread\fP(2) as received; no erase and kill \-cbreak make characters available to \fIread\fP only when newline is received .TE and allows .Sy erase and .Sy kill to "be of the form \fI'^X'\fP which is interpreted as a 'control X'". A cursory examination of the code .Pq ibid., Pa usr/src/cmd/stty.c reveals that this is achieved by masking it to the bottom .Sy 5 bits, as present-day, and as-expected for .Tn ASCII . It's salient to note that the other new .Sx Special Control Characters are indeed not changeable. .Pp .Oo Sy \- Oc Ns Sy hup is replaced with just .Sy hup , calling .Nm ioctl Ns Pq Dv TIOCHPCL . It's unclear how you'd unset this. Removal of .Sy \-hup is undocumented. .Pp An undocumented .Sy gspeed mode, equivalent to .Sy ispeed 300 ospeed 9600 (but keep in mind neither primitive exists yet) appears, and .Sy tab3 is, naturally, removed (but not from the manual), .Pp The no-argument output formats nonprintable (control) .Sy erase and .Sy kill in the expected way; the flag line is unchanged as much as possible, with the explicit singling-out of .Dv XTABS as .Sy \-tabs .Pq and no Sy tab Ns Op Sy 012 . . .Ss Third Berkeley Software Distribution The section covering .Sy @# notes that "Most users prefer to use a backspace rather than '#', and many prefer control X instead of '@'", pointing to \fItset\fP(1) .Pq cf. Sx Lies by Omission and \fIstty\fP(1) to alter this \(em .Rs .%B UNIX Programmer's Manual, Seventh Edition, Virtual VAX\-11 Version .%C Berkeley, California 94720 .%D December, 1979 .%O Introduction to Volume 1, How to Get Started, \fIHow to communicate through your terminal.\fP, para. 3 .%P \*[doc-Pa-font]usr/man/man0/intro\fP .%Q Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]3bsd\fP .Re .Pp .Xr getty,vm 8 .Pq ibid., Pa usr/man/man8/getty.vm.8 loses the table enumeration in the manual (and moves some tables around, but there are 13 with 16 total modes, one of which being an "LSI Chess Terminal"(?) whose login message is .Qq Sy * ; these are out of scope) and special escapes before the login messages .Pq except for table Sq Sy 1 , sends a line consisting of .Qq Virtual Va myname , where the latter is a primordial form of hostname defined in .In ident.h , before the "login:" one, explicitly ignores (i.e. re-does the identification and prompt at the same speed) login names without letters, and sleeps for a second after prompting and before trying to read the name, then .Fn stty Ns s again to dump the buffer: .Bd -literal -compact -offset 4n /* * Wait a while, then flush input to get rid * of noise from open lines */ .Ed .Pp There is a .Xr stty 2 .Pq ibid., Pa usr/man/man2/stty.2 but it's an odd mishmash of .%B Sixth Edition values .Pq esp. Dv HUPCL with .%B Seventh Edition .Xr tty 4 format. .Xr tty 4 (\c .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 , .Pa usr/man/man4/tty.4 ) is expectedly as in .%B Seventh Edition . .Pp .Xr stty 1 (\c .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 , .Pa usr/man/man1/stty.1 ) removes the \fI'^X'\fP description, lists default values for .Sy erase kill and finally allows setting the .Sx Special Control Characters : .TS l4zw0 l2b lx . intr\fI c\fP set interrupt character to \fIc\fP (default DEL.) quit\fI c\fP set quit character to \fIc\fP (default control \e.) start\fI c\fP set start character to \fIc\fP (default control Q.) stop\fI c\fP set stop character to \fIc\fP (default control S.) eof\fI c\fP set end of file character to \fIc\fP (default control D.) brk\fI c\fP T{ set break character to \fIc\fP (default undefined.) This character is an extra wakeup causing character. T} .TE These all \(em sans .Sy brk \(em match their present-day spellings. .Pp By peeping the source .Pq ibid., Pa usr/src/cmd/stty.c , we find that despite the \fI'^X'\fP removal, it's both still valid, .Em and .Sy ^?\& is accepted as DEL .Pq Sy 0177 , 0x7F , as well as that .Sx Special Control Characters not followed by a character is ignored instead of segfaulting. .Pp The no-argument output is suitably updated as well: after the speed lines, the .Sx Special Control Characters are listed as such: .Bd -literal -compact -offset 4n .Li erase = Ar cc Ns Li "; kill" = Ar cc Ns Li "; intr" = Ar cc Ns Li "; quit" = Ar cc .Li start = Ar cc Ns Li "; stop" = Ar cc Ns Li "; eof" = Ar cc Ns Li "; brk" = Ar cc .Ed Where .Ar cc is also as present-day: .Qq Li if .Sy 0377 .Pq Sy \-1 , else .Qq Li M- if the top bit set then .Qo Li ^?\& Qc Ns / Ns Qo Li ^ Ns Ar c Qc Ns / Ns Qo Ar c Qc . .Pp The settings for non-delay modes .Pq incl. Dv XTABS Ns "" Pq Oo Sy \- Oc Ns Sy tabs are always written, format otherwise unchanged. . .Ss Fourth Berkeley Software Distribution Refuses input and rings the bell on input overflow .Pq Pf \[=~] Sy imaxbel "if your prompt was a %" \(em that is, with .Xr csh 1 , that is, with the "new" line discipline \(em and declares that "many prefer control-U instead of '@'" now; additionally, "Many users change this interrupt character to be ^C (control-C) using \fIstty\fP(1)."; finally, .Bd -filled -compact -offset 4n It is also possible to suspend output temporarily using ^S (control-s) and later resume output with ^Q. In a newer terminal driver, it is possible to cause output to be thrown away without interrupting the program by typing ^O; see \fInewtty\fP(4). .Ed and .Bd -filled -compact -offset 4n If you use \fIcsh\fP(1) the key ^Z (control-z) will cause jobs to "stop". If this happens before you learn about it, you can simply continue by saying "fg" (for foreground) to bring the job back. .Ed .Rs .%B UNIX Programmer's Manual, Seventh Edition, Virtual VAX\-11 Version .%C Berkeley, California 94720 .%D November, 1980 .%O Introduction to Volume 1, How to Get Started, \fIHow to communicate through your terminal.\fP, paras. 2-4 .%P \*[doc-Pa-font]usr/man/man0/intro\fP .%Q Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.0\fP .Re .Pp Indeed, as the .Sx PREFACE .Pq ibid., Pa usr/man/man0/intro states: "This release finds the system in transition: a number of facilities have been added in experimental versions (job control, resource limits) and" "Applications which use facilities that are in transition should be aware that some of the system calls and library routines will change in the near future." \(em the extent to which the latter is not the case is remarkable: these facilities remain enshrined, essentially unchanged, to this day. .Pp .\" $ wc -lc 3bsd/usr/man/man4/tty.4 4.0/usr/man/man4/tty.4 .\" 469 13118 3bsd/usr/man/man4/tty.4 .\" 822 28860 4.0/usr/man/man4/tty.4 .Xr tty 4 .Pq ibid., Pa usr/man/man4/tty.4 more than doubles in size; this is reasonable, given that it describes double the amount of "terminal drivers used for conversational computing" (nominally three, but the third is the "net" .Dv NETLDISC one, used for Berknet, described in full in .Xr bk 4 .Pq ibid., Pa usr/man/man4/bk.4 , and entirely out of scope here) \(em line disciplines, configurable with .Nm ioctl Ns Pq Dv TIOC Ns Oo Dv GS Oc Ns Dv ETD , with the "old (standard) terminal driver", "used when using the standard shell \fIsh\fP(1) and for compatibility with other standard version 7 UNIX systems" defined as .Dv OTTYDISC .Pq "0 by convention" , and the "newer terminal drivers, with features for job control", which .Pq must be used when using Xr csh 1 , as .Dv NTTYDISC . .Pp This is also the system that originates modern-day process groups \(em complete with .Oo Nm gs Oc Ns Fn etpgrp , .Nm ioctl Ns Pq Dv TIOC Ns Oo Dv GS Oc Ns Dv PGRP , &c., cf.\& .Xr jobs 3J .Pq ibid., Pa usr/man/man3/jobs.3j \(em which are fully formed, to \(*e, with the "new" discipline, and as such so truly .Em remarkably unremarkable that one may as well consult modern .Xr credentials 7 . .Pp The three major modes \(em cooked, CBREAK, RAW \(em are described completely and separately as "all driver functions" available, no input processing, and no processing (sans .Dv LFLUSHO ) , respectively. RAW returns BREAKs as NULs; this is the first time this is documented outside .Xr getty 8 . .Pp For input, .Dv NTTYDISC introduces "a literal-next character ^V" .Pq Sy lnext , No as present-day "which can be typed in both cooked and CBREAK mode preceding \fBany\fP character to prevent its special meaning.", which is preferred to escaping .Sy erase kill with a .Sy \e , retained only for "historical reasons" (but even that sees an update with only the escaped character being echoed). as well as "The word-erase charactrer, normally ^W", which "erases the preceding word", "defined as a sequence of non-blank characters, with tabs counted as blanks" .Pq Sy werase , No as present-day, to precision of Sy altwerase . and "Finally, the reprint character, normally ^R, retypes the pending input beginning on a new line.", which happens "automagically in cooked mode if characters which would normally be erased from the screen are fouled by program output."; it's unclear how this is mediated. .Pp In .Dv OTTYDISC .Sy erase is just echoed and .Sy kill is additionally followed by a newline .Pq as-if Sy echok \-echoke , "(even if the character is not killing the line, because it was preceded by a '\e'!.)" (notably, this isn't documented in any manuals heretofor; it's unclear when exactly this stopped being .Sy \-echok ) \(em whereas "new terminal driver has several modes for handling the echoing of terminal input, controlled by bits in a local mode word." (notably, this is the first occurrence of the "local flags", so spelled and so separated). These flags are largely as present-day behaviourally, though decidedly not as present-day spelling-wise, and are outlined below. .Pp For output, EOT is not transmitted in cooked mode (as opposed to only if RAW), so "programs using raw or cbreak mode should be careful"; .Dv NTTYDISC adds "a output flush character, normally ^O" .Pq Sy discard , No as present-day , "which sets the LFLUSHO bit in the local mode word, causing subsequent output to be flushed until it is cleared by a program or more input is typed."\& .Pq Sy flusho , No as present-day \(em which happens in cooked and CBREAK modes and input is .Sy rprnt Ns ed after resumption. .Pp If .Dv LCASE , under .Dv NTTYDISC , upper-case bytes, in addition to the punctuation, are preceded by .Sy \e Ns es on ouypuy, which is finally as present-day. A provision for .Qq Hazeltine terminals, which do not understand that ~ has been made into an Tn ASCII No character is made via .Dv LTILDE , which outputs .Sy ~ .Po Sy 0x7E Pc Ns s as .Sy ` .Po Sy 0x60 Pc Ns s . .Pp When the line is hung up, the "distinguished" (foreground) process group is signalled, as present-day; .Dv LNOHANG disables this. .Pp The interface is, expectedly, insane: "there are 4 different structures which contain various portions of the driver data."; .Vt "struct sgttyb" .Fa sg_flags returns to being 16-bit by becoming .Vt short , with no other layout changes, but .Dv CR3 "is suitable for the concept-100 and pads lines to be at least 9 characters at 9600 baud." The former refers to .Tn Human Designed Systems .Tn Concept Ns -series video terminals; the latter is unclear. This corresponds to no modern mode. .Pp .Vt "struct tchars" is unchanged. .Pp .de UL .ie t \\$1\\$2\l'-\w'\\$2'u\(ul'\\$3 .el \\$1\fI\\$2\fP\\$3 .. The new .UL \&" "Local mode" \&", a word, applies (except for .Dv LNOHANG ) , to .Dv NTTYDISC only, settable with .Dv TIOCL Ns Oo Dv GS Oc Ns Dv ET , with bit-manipulation .Fn ioctl Ns s .Dv TIOCLBI Ns Op Dv CS having the expected result. .Pp .TS l l l lfCR lb l . Macro Equiv. Description _ LCRTBS \fR(see below)\fP Backspace on erase rather than echoing erase LPRTERA echoprt Printing terminal erase mode LCRTERA \fR(see below)\fP Erase character echoes as backspace-space-backspace LTILDE Convert ~ to ` on output (for Hazeltine terminals) LMDMBUF Stop/start output when carrier drops LLITOUT \fR(see below)\fP Suppress output translations LTOSTOP tostop Send SIGTTOU for background output LFLUSHO flusho Output is being flushed LNOHANG Don't send hangup when carrier drops LETXACK Diablo style buffer hacking (unimplemented) LCRTKIL \fR(see below)\fP BS-space-BS erase entire line on line kill LINTRUP Generate interrupt SIGTINT when input ready to read LCTLECH echoctl Echo input control chars as ^X, delete as ^? LPENDIN Retype pending input at next read or input character .TE .Pp The erasure mode tree is slightly different; assuming .Sy echo : .Bl -tag -compact -offset 4n -width ".No if Dv LCRTBS \&| LCRTERA" .It if Dv LCRTBS \&| LCRTERA backspace, space, backspace .Pq present-day Sy \-echoprt \-echoe ; .It if Dv LCRTBS backspace; .It if Dv LPRTERA backslash, columns, then slash on next output .Pq present-day Sy echoprt ; .It otherwise .Sy erase .Pq present-day Sy \-echoprt echoe . .El .Sy kill Ns s are backspace, space, backspace for the whole line if .Dv LCRTERA or backspace to the beginning of the line otherwise .Pq closest to Sy echok echoke if .Dv LCRTKIL and unfouled, otherwise echo .Sy kill , newline .Pq Sy -echok \-echoke . .Pp .Dv LMDMBUF functions like .Dv TANDEM , but rather than reacting to water-marks, it does to carrier events, and only does something under the "new" DM-BB driver, which bears a "NB: WE HAVEN'T TESTED dhdm CODE ON VAX.", disclaimer. .Dv LETXACK is unused and otherwise undocumented. .Dv LPENDIN is a flag set internally by the driver to facilitate reprinting input after .Dv TIOCSET Ns Op Dv PN from CBREAK to cooked input (settable by userspace, but not used by the distribution userland). .Pp .Dv LINTRUP is unused in the distribution userland except as .Nm stty Oo Sy \- Oc Ns Sy intrup . A mode rather similar to .Dv LNOHANG may be found in .Sy clocal . .Pp Likewise for the new .UL \&" "Local special chars" \&", .Dv TIOC Ns Oo Dv GS Oc Ns Dv LTC : .Bd -literal -compact -offset 4n .ds ota \n[.tabs] .ta .5i 1i 2i .ft B struct ltchars { char t_suspc; /* stop process signal */ char t_dstopc; /* delayed stop process signal */ char t_rprntc; /* reprint line */ char t_flushc; /* flush output (toggles) */ char t_werasec; /* word erase */ char t_lnextc; /* literal next character */ }; .ta \*[ota] .ft P .Ed With expected present-day defaults of .Sy ^ Ns Ar Z , .Sy ^ Ns Ar Y , .Sy ^ Ns Ar R , .Sy ^ Ns Ar O , .Sy ^ Ns Ar W , .Sy ^ Ns Ar V , and expectedly disabled if .Sy \-1 . .Pp The .Sx BUGS concedes to .Tn TENEX fans and that paragraph disappears. .Pp This is undocumented, but the .UL \&" "Local special chars" \&" are reset to kernel defaults when a teletype device is opened and doesn't have any open descriptors. This explains why .Nm getty .Pq ibid., usr/src/cmd/getty.c just resets the discipline to .Dv OTTYDISC . .Pp .Xr stty 1 .Pq ibid., Pa 4.0/usr/man/man1/stty.1 , rather than the "current settings", reports: .Bd -filled -compact -offset 4n the speed of the terminal and the settings of the options which are different from their defaults. With the argument "all", all normally used option settings are reported. With the argument "everything", everything \fIstty\fP knows about is printed. .Ed .Pp Character arguments may start with .Qq Sy u to mean undefined .Pq Sy \-1 \(em the manual describes this as "\(Fcu\(Fo or \(Fcundef\(Fo". .Pp .Sy raw cbreak are updated to reflect their behaviour in .Xr tty 4 , and .Sy hup \-hup are removed (but only from the manual, .Sy hup remains unchanged in .Pa usr/src/cmd/stty.c ) . The only new options in the main block are, at last: .TS l4zw0 lb lx . tandem T{ enable flow control, so that the system sends out the stop character when its internal queue is in danger of overflowing on input, and sends the start character when it is ready to accept further input T} \-tandem disable flow control .TE .Pp A separate chunk of options is added, caveated on applying only to the new driver .Pq with the new Nm csh : .TS l4zw0 l2b lx . new Use new driver (switching flushes typeahead). crt Set options for a CRT (crtbs, ctlecho and, if >= 1200 baud, crterase and crtkill.) crtbs Echo backspaces on erase characters. prterase For printing terminal echo erased characters backwards within "\e" and "/". crterase Wipe out erased characters with "backspace-space-backspace." \-crterase Leave erased characters visible; just backspace. crtkill Wipe out input on like kill ala \fBcrterase.\fP \-crtkill Just echo line kill character and a newline on line kill. ctlecho T{ Echo control characters as "^\fIx\fR" (and delete as "^?".) Print two backspaces following the EOT character (control D). T} \-ctlecho Control characters echo as themselves; in cooked mode EOT (control-D) is not echoed. tostop Background jobs stop if they attempt terminal output. \-tostop Output from background jobs to the terminal is allowed. tilde Convert "~" to "`" on output (for Hazeltine terminals). \-tilde Leave poor "~" alone. flusho Output is being discarded usually because user hit control O (internal state bit). \-flusho Output is not being discarded. pendin T{ Input is pending after a switch from cbreak to cooked and will be re-input when a read becomes pending or more input arrives (internal state bit). T} \-pendin Input is not pending. intrup T{ Send a signal (SIGTINT) to the terminal control process group whenever an input record (line in cooked mode, character in cbreak or raw mode) is available for reading. T} \-intrup Don't send input available interrupts. mdmbuf Start/stop output on carrier transitions (not implemented). \-mdmbuf Return error if write attempted after carrier drops. litout Send output characters without any processing. \-litout Do normal output processing, inserting delays, etc. nohang Don't send hangup signal if carrier drops. \-nohang Send hangup signal to control process group when carrier drops. etxack Diablo style etx/ack handshaking (not implemented). .TE All of these correspond directly to the .UL \&" "Local mode" \&" bits, except for .Qq Sy new , which, as expected, sets .Dv NTTYDISC , .Qq Sy crt , the positive .Qq Sy crt* options that unset .Dv LPRTERA , and .Qq Sy prtterase that unsets all .Qq Sy crt* flags. The conspicuously-missing .Sy \-crtbsd \-prterase are present but undocumented; the less-conspicuously missing .Qq Sy old sets .Dv OTTYDISC . There is a .Qq Sy newcrt which is equivalent to .Qq Sy new crt , and is described only in .Xr tty 4 . .Pp And a similarly-caveatted (and "not normally changed") list of characters: .TS l4zw0 lb lx . susp\fI c\fP set suspend process character to \fIc\fR (default control Z.) dsusp\fI c\fP set delayed suspend process character to \fIc\fR (default control Y.) rprnt\fI c\fP set reprint line character to \fIc\fR (default control R.) flush\fI c\fP set flush output character to \fIc\fR (default control O.) werase\fI c\fP set word erase character to \fIc\fR (default control W.) lnext\fI c\fP set literal next character to \fIc\fR (default control V.) .TE These are all entirely as present-day. .Pp There is an (undocumented, of course) query: .Sy speed , which writes the output speed of .Pa /dev/tty to the standard output stream and exits .Sy 0 .Pq or writes \&"unknown" and exits Sy 1 No if the speed is unknown . .Pp .Qq Sy crt , additionally to described, clears .Dv LPRTERA ; the rationale is, naturally, found in .Xr tty 4 : "At speeds less than 1200 baud, the LCRTERA and LCRTKILL processing is painfully slow" \(em and can be approximated at a tenth of a second per column erased at .Sy 300 baud. .Pp The output format is globally compressed; the first line starts with .Qq Li net discipline, \& if .Xr bk 4 is in use, .Qq Li new tty, \& if .Dv NTTYDISC , or .Qq Li old tty, \& if .Qq Sy everything . The speeds are printed on the same line (by just dropping the newline from the end of the speed printing function; this, of course, means that if the input and output speeds are different, like in .Qq Sy gspeed mode, they're written as .Qq Li "input speed 300output speed 9600" ; this once more supports the point that split-speed teletypes just weren't in use). Thus the line ends if .Qq Sy everything or a semicolon separates otherwise. .Pp The mode output is identical (sans .Qq Oo Sy \- Oc Ns Sy tandem , after .Qq Oo Sy \- Oc Ns Sy lcase ) if .Qq Sy everything , otherwise the "defaults" are .Dv EVENP \&| ODDP , .Li !\& Ns Dv RAW , .Dv CRMOD , .Dv ECHO , .Li !\& Ns Dv LCASE , .Li !\& Ns Dv TANDEM , .Pq Dv XTABS Ns " always" reported , .Li !\& Ns Dv CBREAK , and no delays. If .Qq Sy all or .Qq Sy everything the line is broken. .Pp The default .UL \&" "Local mode" \&"s are all unset; in .Dv NTTYDISC , they follow in (mostly) the order listed. The only quirk is that .Qq Sy crt is coalesced and listed as-if a first-class option if the .Qq Sy crt* and .Qq Sy prterase all match, except that it's considered to start to include .Dv LCRTERA \&| LCRTKIL at .Sy 600 baud, and if .Qq Sy everything is listed as .Qq Li "crt: (crtbs crterase crtkill ctlecho)" ; the line is broken here if any flags were listed. .Pp In no-argument output, unless under .Xr bk 4 , non-default .Sx Special Control Characters (and, under .Dv NTTYDISC .UL \&" "Local special chars" \&") are written in the same format as previous, but only if they differ from the defaults .Pq as described, except for Sy erase No which is Sy ^ Ns Ar H ; otherwise, if .Qq Sy all or .Qq Sy everything , they're listed in a two-line tabulated format: .Bd -literal -compact -offset 4n erase kill intr quit stop eof .Ed for .Dv OTTYDISC , with undefined ones not written, and in the .Li stop column either .Sy stop or .Sy start listed if just one is set (or they're the same) or both but separated by a .Li / . The same holds for .Sy eof and .Sy eol in .Li eof . For .Dv NTTYDISC , the columns are: .TS center; lfCR . erase kill werase rprnt flush lnext susp intr quit stop eof .TE additionally, the .Li susp column can list .Sy susp and/or .Sy dsusp in the same manner. .Pp This is, perhaps, best illustrated with an example; for a .Tn VT05 in a reasonable .Nm Ar 1200 vt05 new crt kill ^X rprnt u susp u nohang mode, .Nm stty Sy all yields: .TS center; lfCR . new tty, speed 1200 baud; nl2 crt nohang erase kill werase rprnt flush lnext susp intr quit stop eof ^H ^X ^W ^O ^V ^Y ^? ^\e ^S/^Q ^D .TE and for a .Tn Model 37 in a reasonable .Nm Ar 150 new tty37 nl prterase mode .Nm stty yields: .Bd -literal -compact -offset 4n speed 150 baud; nl nl1 tab1 cr1 ff1 prterase erase # .Ed . .Ss 4.1 Berkeley distribution .\" So called in BSD4.2 Adds .TS l4zw0 lfCR l . LDECCTQ /* only ^Q starts after ^S */ LNOFLSH /* dont flush output on signals */ .TE Which are equivalent to .Oo Sy \- Oc Ns Sy ixany and .Oo Sy \- Oc Ns Sy noflsh . .Pp .Rs .%P \*[doc-Pa-font]sys/h/ioctl.h\fP, \*[doc-Pa-font]sys/dev/ttynew.c\fP .%I Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .%R 4.1BSD .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.1/4.0.upgrade\fP .Re .\" No documentation, everything outside of 4.0.upgrade the same . .Ss 4.2 Berkeley Software Distribution .Nm getty , taking the table name, reaches its full potential by iterating through a (fully-formed) termcap at .Pa /etc/gettytab , which includes a default with the (now actual) hostname \(em .Rs .%B UNIX Programmer's Manual, 4.2 Berkeley Software Distribution, Virtual VAX\-11 Version .%C Berkeley, California 94720 .%D August, 1983 .%O \*[doc-Xr-font]getty\fP(8), \*[doc-Xr-font]gettytab\fP(5) .%P \*[doc-Pa-font]usr/man/man8/getty.8\fP, \*[doc-Pa-font]usr/man/man5/gettytab.5\fP .%Q Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.2\fP .Re The latter's .Sx BUGS note that: .Bd -filled -compact -offset 4n Some ignorant peasants insist on changing the default special characters, so it is wise to always specify (at least) the erase, kill, and interrupt characters in the \fBdefault\fP table. In \fBall\fP cases, '#' or '^H' typed in a login name will be treated as an erase character, and '@' will be treated as a kill character. .Pp The \fBhe\fP capability is stupid. .Pp \fITermcap\fP format is horrid, something more rational should have been chosen. .Ed A description of the \fBhe\fP capability has been omitted here for the sanity of the reader; it is, by a long shot, the dumbest part of the source materials for this manual. Truly, this is the pinnacle of software. .Pp The relevant revolutionary new part of .Xr getty 8 is that can hang up if the login name is not obtained in time .Pq Sy to No property . .Pp All mentions of .Fn stty Ns / Ns Fn gtty are removed from .Xr ioctl 2 .Pq ibid., Pa usr/man/man2/ioctl.2 , which just directs the reader to the section-4 page they're interested in; .Xr stty 3C .Pq ibid., Pa usr/man/man3/stty.3c , where C is for Compatibility, is described as defunct and obsolteded by .Xr ioctl 2 . .Pp .Dv LINTRUP is "replaced by a call to fcntl and the SIGIO signal."\(em .Rs .%A Samuel J. Leffler .%B Bug fixes and changes in 4.2BSD .%C Berkeley, California 94720 .%D July 28, 1983 .%O Section 2. .%P \*[doc-Pa-font]usr/doc/uchanges/3.t\fP .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.2\fP .Re The equivalent call is .Dv F_SETFL with .Dv FNDELAY \&| FASYNC . .Pp .Xr tty 4 (\c .%B 4.2 Berkeley Software Distribution , .Pa usr/man/man4/tty.4 ) expands on .Dv LDECCTQ as "Only ^Q restarts output after ^S, like DEC systems"; .Dv LNOFLSH remains entirely undocumented. .Pp .Vt "struct ltchars" .Fa t_dstopc is renamed to .Fa t_dsuspc (it's unclear why it hasn't been that from the beginning), and .Fa t_werasec to .Fa t_werasc (to fit in the 8-byte limit of older compilers, presumably). .Pp .Xr stty 1 .Pq ibid., Pa usr/man/man1/stty.1 sees the addition of .TS l4zw0 lb lx . dec T{ set all modes suitable for Digital Equipment Corp. operating systems users; (erase, kill, and interrupt characters to ^?, ^U, and ^C, decctlq and "newcrt".) T} decctlq T{ After output is suspended (normally by ^S), only a start character (normally ^Q) will restart it. This is compatible with DEC's vendor supplied systems. T} \-decctlq T{ After output is suspended, any character typed will restart it; the start character will restart output without providing any input. (This is the default.) T} .TE These all survive today as-described. .Pp The .Tn DEC operating systems are pretty much any of them, to an extent: .Tn TENEX doesn't count, since that's originally .Tn BBN , but .Sx Third Berkeley Software Distribution says that "many prefer control X instead of '@'" \(em .Tn TENEX uses .Sy ^ Ns Ar X : .Rs .%A Theodore H. Myer .%A Jogn R Barnaby .%A William W. Plummer .%B TENEX Executive Manual, TENEX Executive Language, Manual for Users .%C 50 Moulton Street, Cambridge, Massachusetts 02138 .%D January, 1971; revised April, 1973 .%I Bolt Beranek and Newman Inc. .%O II. Executive Language Structure, C. Editing and Errors in TENEX commands, 4. (CTRL)-X, Rubout .%P p. 18 .\" http://bitsavers.org/pdf/bbn/tenex/TenexExecRef_Apr73.pdf .%U http://bitsavers.org/\:pdf/\:bbn/\:tenex/\:TenexExecRef_Apr73.pdf .Re And single-character erasure echoes a .Sy \e followed by the erased column every time. .Sy ^ Ns Ar R reprints the line after CR. .Pp .Tn TOPS-20 is almost there: DEL is .Sy erase , .Sy ^ Ns Ar U is .Sy kill \(em .Rs .%B TOPS-20 System Manager's Guide .%D December 1984 (first printing October 1976) .%N Version 6.0 Interim Release Draft .%O Creating the TOPS-20 File System, Step 13, DELETE Key .%P p. 2-9 .%Q Digital Equipment Corporation .\" http://bitsavers.org/pdf/dec/pdp10/TOPS20/TOPS-20_V6_System_Managers_Guide_Interim_Dec84.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:pdp10/\:TOPS20/\:TOPS-20_V6_System_Managers_Guide_Interim_Dec84.pdf .Re .Pp .Tn VMS sees the full range here: .Sy ^ Ns Ar O , .Sy ^ Ns Ar S , .Sy ^ Ns Ar Q , .Sy ^ Ns Ar R , .Sy ^ Ns Ar U , all as-described, and .Sy ^ Ns Ar X which is equivalent to .Sy ^ Ns Ar U in the .Tn UNIX context \(em .Rs .%B VAX/VMS I/O User's Guide .%C Maynard, Massachusetts .%D August 1978 .%N AA-D028A-TE .%O Chapter 2, Terminal Driver, 2.2.6 Control Characters and Special Keys, Table 2-1, Termianl Control Characters .%P pp. 2-5, 2-6, 2-7 .%Q Digital Equipment Corporation .\" http://bitsavers.org/pdf/dec/vax/vms/1.0/AA-D028A-TE_VAX_VMS_IO_Users_Guide_Aug78.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:vax/\:vms/\:1.0/\:AA-D028A-TE_VAX_VMS_IO_Users_Guide_Aug78.pdf .Re .Pp Per the juices (\c .%B 4.2 Berkeley Software Distribution , .Pa usr/src/bin/stty.c ) , .Sy 19200 38400 speeds are added as aliases for .Sy exta extb and are written as such, rather than "0", in the current-option listing, .Qq Oo Sy \- Oc Sy extack is .Li #ifdef Ns ed away, and .Oo Sy \- Oc Ns Sy noflsh added. Default characters are now part of the global .In sys/ttychars.h , as present-day, and with present-day names; the surprising difference is that .Sy erase kill intr got .Tn DEC Ns ified into .Sy ^?\& , ^ Ns Ar U Ns ,\& Sy ^ Ns Ar C (from .Sy # , @ , ^?\& in the kernel and .Sy ^ Ns Ar H , .Sy @ , ^?\& in userspace .Nm ( , Nm reset \(em .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 , .Pa usr/src/cmd/reset.c ) ) . . .Ss 4.3 Berkeley Software Distribution No longer "must" one .Qq call Tn UNIX No from an appropriate terminal ; instead, a phone number is necessary only "If you will be accessing UNIX remotely". A direct connection "generally runs at 9600 or 19200 baud", and modem speed is "typically 300, 1200, or 2400 baud" \(em .Rs .%B UNIX User's Reference Manual (URM), 4.3 Berkeley Software Distribution, Virtual VAX\-11 Version .%C Berkeley, California 94720 .%D April, 1986 .%O Introduction to User's Reference Manual, How to get Started, \fILogging in.\fP .%P \*[doc-Pa-font]usr/man/man0/intro.ms\fP .%Q Computers Systems Research Group, Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.3\fP .Re For logging out, the .Ic logout .Xr csh 1 primitive is recommended above EOFing the shell (ibid., \fILogging out.\fP). The \fIHow to communicate through your terminal.\fP section is adamant that DEL and .Sy ^ Ns Ar H have replaced .Sy @# by default \(em there is no evidence of this: they remain .Sy ^ Ns Ar H and .Sy ^ Ns Ar U . And provides an ominous note: .Bd -filled -compact -offset 4n If the terminal does not appear to be echoing anything that you type, it may be stuck in "no-echo" or "raw" mode. Try typing "(control-J)reset(control-J)" to recover. .Ed \fIText processing.\fP replaces the eternal (since .%B Third Edition , which introduced the How to Get Started section) .Nm pr recommanedation ("paginates the text, supplies headings, and has a facility for multi-column output") with a .Nm more one ("is useful for preventing the output of a command from scrolling off the top of your screen.") .Pp .Xr ttys 5 , rather than being a trivial columnated list, is now fully comment-capable and paraeterised with regards to what to run with full cmdline, where, what type of terminal is on it, and arbitrary parameters to the programs run; this includes running .Nm xterm Ns s ; this is as present-day in most Berkeley derivatives \(em .Rs .%B UNIX Programmer's Reference Manual (PRM), 4.3 Berkeley Software Distribution, Virtual VAX\-11 Version .%C Berkeley, California 94720 .%D April, 1986 .%P \*[doc-Pa-font]usr/man/man5/ttys.5\fP .%Q Computers Systems Research Group, Computer Science Division, Department of Electrical Engineering and Computer Science, University of California .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_1_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 1, Berkeley Systems 1978-1986, \*[doc-Pa-font]4.3\fP .Re .Xr tty 4 .Pq ibid., Pa 4.3/usr/man/man4/tty.4 finally stops mentioning .Xr bk 4 .Pq ibid., Pa 4.3/usr/man/man4/bk.4 (though it's not fully removed, only marked "(obsolete)" with a .Sx BUGS section that lays out why it's not fit for purpose), and the listing is reworded to "there are two line disciplines available for use with terminals" which makes much more sense, given that .Xr bk 4 is (unsuitable) for uploading data from microprocessors; ominously, "Other disciplines may exist for special purposes, such as use of communications lines for network connections.". .Pp .Dv TIOCNOTTY , detaching the caller from its controlling terminal, available since .%B 4.2 Berkeley Software Distribution , is finally documented. .Sy eof is finally documented as one of the inputs that end lines in cooked mode in-line. The .Tn DEC Ns ified defaults are propagated to the description. .Dv TIOCHPCL is now "usually done on outgoing lines and dialups.", and the userland agrees with this. .Pp Rather than always outputting even parity, odd parity may be generated by setting .Dv ODDP .Li !\& Ns Dv EVENP . .Pp .Dv TIOCSTOP and .Dv TIOCSTART .Fn ioctl Ns s appear to emulate pressing .Sy stop start . It's unclear if .Dv TIOCSTI Ns ing them would suffice. .Pp One new .UL \&" "Local mode" \&" bit appears: .TS l4zw0 lfCR l . LPASS8 Pass all 8 bits through on input, in any mode LNOFLSH Inhibit flushing of pending I/O when an interrupt character is typed. .TE .Dv LPASS8 .Pq in place of Dv LINTRUP is additionally described as overriting normal parity validation in cooked and CBREAK modes (and supposedly what happens in RAW mode). It's unclear what this actually means. .Oo Sy \- Oc Ns Sy pass8 survives as an alias; it's unclear if it retains its meaning. .Pp Window size provisions appear fully-formed as present-day, "to accommodate terminals and workstations with variable-sized windows": .Dv SIGWINCH , .Dv TIOC Ns Bo Dv GS Bc Ns Dv WINSZ , and .Bd -literal -compact -offset 4n .ds ota \n[.tabs] .ft B .ta .5i +\w'unsigned short\ \ \ \ 'u +\w'ws_ypixel;\ \ \ \ \ 'u struct winsize { unsigned short ws_row; /* rows, in characters */ unsigned short ws_col; /* columns, in characters */ unsigned short ws_xpixel; /* horizontal size, pixels */ unsigned short ws_ypixel; /* vertical size, pixels */ }; .ft P .ta \*[ota] .Ed .Xr stty 1 (\c .%B PRM, 4.3 Berkeley Software Distribution , .Pa usr/man/man1/stty.1 ) is prefixed with a list of .Sx Queries : .TS l4zw0 lb l . speed The terminal speed alone is printed on the standard output. size The terminal (window) sizes are printed on the standard output, first rows and then columns. .TE of which the latter is new, and as present-day; before job control flags are seen its corresponding setters: .TS l4zw0 lb l . rows\fI n\fP The terminal size is recorded as having \fIn\fP rows. columns\fI n\fP The terminal size is recorded as having \fIn\fP columns. cols\fI n\fP is an alias for \fIcolumns\fP. .TE equally as present-day. .Pp The new .UL \&" "Local mode" \&"s are prescribed as such .TS l4zw0 lb l . pass8 Passes all 8 bits through on input, in any mode. \-pass8 Strips the 0200 bit on input except in raw mode. .TE It's even more unclear how this relates to parity validation. .Pp .Sy size is implemented .Pq ibid., Pa usr/src/bin/stty.c , like .Qq Sy speed , by re-opening .Pa /dev/tty and exiting .Sy 0 ; the purpose of this is unclear. .Pp The window size is written as .Qq Li ,\& Fa ws_row Li rows,\& Fa ws_col Li columns after the speed, if .Qq Sy all or .Qq Sy everything . . .Ss UNIX Programmer's Manual, CB Version Sees a truly unique \fBLogging in.\fP section, alluding to well-developed port-specific .Nm getty tables: .Bd -filled -compact -offset 4n Usually, the same telephone number serves terminals operating at speeds of 110, 150, and 300 baud. A different number may be used for 1200-baud service. .Ed and caveats \fIHigher-speed terminals\fP on their performance: .Bd -filled -compact -offset 4n Terminals designed to run at higher data rates than 300 baud (i.e., 1200 baud) can be utilized in full-duplex mode provided \fIinput\fP remains character-by-character, typing speed. .Ed (it's unclear what the latter means, but this would point at having two models of .Tn DC11 Ns s installed, since that particular combination of speeds is unavailable and .Tn DH11 Ns s can do all of these, and more, at once; but this is not the case, see below). Aside from the .Qq Tn \fITELETYPE\fP\(rg No Model 37 , used as an example of .Pf < Sy 300 Ns -baud teletypes, no devices, models, or brands are mentioned (conversely, .%B Seventh Edition mentions no fewer than .Em 7 models from .Em 5 brands). It is also uniquely noted that: "The system may prompt you for a dialup password which is established by the system administrator (you need to know it to use any dial port into the system)." \(em this is mediated by .Nm login after the normal password prompt. And a special, shockingly content-free for the length, \fINon-dial Terminals\fP section. .Rs .%A J. D. Doan .%B CB-UNIX Programmer's Manual .%C Columbus, OH 43213 .%D May 1981 .%I Department 59473, Bell Telephone Laboratories, Incorporated .%N Edition 2.3 .%O How To Get Started; \*[doc-Xr-font]login\fP(1) .%P \*[doc-Pa-font]cbunix_intro.pdf\fP, pp. viii-ix;\*[doc-Pa-font] cbunix_man1_04.pdf\fP, p. 4 .\" https://www.tuhs.org/Archive/Distributions/Distributions/USDL/CB_Unix .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Distributions/\:USDL/\:CB_Unix .%V Volume 1 .Re .Pp A new \fBLogging out,\fP method of sitting around for a while is noted, based on (lack of) teletype activity. As compared to .%B Sixth Edition (from which a "large part of the present manual's contents is descended" (\c .%B CB-UNIX Programmer's Manual , .Pa cbunix_intro.pdf , ACKNOWLEDGEMENTS, p. iii)), .Sy ^ Ns Ar S can "temporarily stop output", which "is useful with CRT terminals to prevent output from disappearing before it can be read.", and is only resumed with a .Sy ^ Ns Ar Q \(em these are as-present-day .Sy stop start defaults in .Sy \-ixany mode. Additionally, .Bd -filled -compact -offset 4n On .Tn CB-UNIX only, output may also be stopped by typing the break or escape keys. In this case, typing another escape (or any other characters, for that matter) will cause output to be resumed. .Ed which corresponds to .Sy ixany for this alternate keying. .Pp 2.3 is, of course, a late version of the system, but, in the words of an unnamed "retired CB/UNIX developer"; .Bd -filled -compact -offset 4n Other things that immediately come to mind that we added first in Columbus Unix were power-fail restart (myself and Jim McGuire did the initial work) and line-disciplines and terminal types (Bill Snider did the initial work). .Ed and .Bd -filled -compact -offset 4n we started using the C version in early 1975 as I recall. .Ed as per .Rs .%O final para. .\" https://www.tuhs.org/Archive/Distributions/Distributions/USDL/CB_Unix/readme.txt .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Distributions/\:USDL/\:CB_Unix/\:readme.txt .Re .\" https://minnie.tuhs.org/pipermail/tuhs/2013-September/006066.html This mostly lines up with the citing of .%B Sixth Edition : the manual includes parts of .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 and .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 \(em in some portions with the branding in tact. Nevertheless, given that .Bd -filled -compact -offset 4n I was the supervisor of the group in Columbus for a number of years that was responsible for the development of CB-UNIX. .Ed and .Bd -filled -compact -offset 4n The SCCS version of UNIX had a number of unique features for the times: semaphores and line disciplines (in 1974!) for example. Hal Pearson was responsible for semaphores, and Bill Snider for line disciplines. .Ed mostly lines up with the aforementioned \(em .Rs .%A Dale DeJager .%D 1984-01-17 .%J net.unix .%T UNIX History .\" https://groups.google.com/g/net.unix/c/-H9x36DMOBQ/m/P_G_s9SJBrgJ .%U https://groups.google.com/\:g/net.unix/c/\:-H9x36DMOBQ/m/P_G_s9SJBrgJ .Re It's not outlandish to say that the extensive discipline system, outlined below, .Em does land somewhere in the fore of the tail half of the 1970s more so than its aft, perhaps to the precision of its extent. \*[doc-Xr-font]pr\fP (1)s of the kernel are also scanned, and dated; helpfully, it's .Qq Li "Sat Feb 9 09:01:00 1980" and .Qq Li Jan 26 17:20 so using them as anything more than a disambiguation is useless \(em .Rs .%O \*[doc-Pa-font]cbunix3.pdf\fP .%R CB-UNIX Source Code .\" https://www.tuhs.org/Archive/Distributions/Distributions/USDL/CB_Unix/SourceCode .%U https://www.tuhs.org/\:Archive/\:Distributions/\:Distributions/\:USDL/\:CB_Unix/\:SourceCode .Re Most .Pq sans Xr ioctl 2 of the teletype-related lines are dated "November 1979" and branded .Tn CB-UNIX 2.1; the wording of \*[doc-Xr-font]tty\fP (4) (\c .%B CB-UNIX Programmer's Manual , .Pa cbunix_man4.pdf , p. 27)'s controllong-teletype-file and it mentioning \*[doc-Xr-font]dh\fP (4) and \*[doc-Xr-font]kl\fP (4) points the most recent common ancestor being .%B Sixth Edition . .Pp The core difference there is that that file is .Pa /dev/ln \(em this follows the console being .Pa ln00 and the dial-in lines being .Pa ln* . \*[doc-Xr-font]dh\fP (4) (\c .%B CB-UNIX Programmer's Manual , .Pa cbunix_man4.pdf , p. 2) is extended to also cover .Tn DZ11 Ns s (also incessantly called "DZ-11"s): "(For DZ-11 lines, output speed is always the same as input speed. The \fI200\fP speed and the two externally clocked speeds \fI(exta, extb\fP ) are missing on the DZ-11.)". The .Tn DZ11 supports a different set of speeds: .TS l4zw0 n1b n n1b n n1b n n1b n . 0 50 Baud 4 150 Baud 8 1800 Baud 12 4800 Baud 1 75 Baud 5 300 Baud 9 2000 Baud 13 7200 Baud 2 110 Baud 6 600 Baud 10 2400 Baud 14 9600 Baud 3 134.5 Baud 7 1200 Baud 11 3600 Baud 15 Not used .TE none of which correspond directly to the corresponding speeds on the .Tn DH11 , and "The receiver clock is turned on and off by setting and clearing bit 12" \(em .Rs .%C Maynard, Massachusetts .%D October 1978 .%N 3rd Printing (Rev) .%O Chapter 3 (Programming), 3.3 Programming Features, 3.3.1 Baud Rate, Table 3-4 Baud Rate Selection Chart .%P p. 3-10 .%Q Digital Equipment Corporation .%R EK-DZ110-TM-002 .%T DZ11 asynchronous multiplexer technical manual .\" http://bitsavers.org/pdf/dec/unibus/EK-DZ110-TM-002_DZ11_Asynchronous_Multiplexer_Technical_Manual_Oct78.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:EK-DZ110-TM-002_DZ11_Asynchronous_Multiplexer_Technical_Manual_Oct78.pdf .Re .Pp And the "Transmitter clock is always on." (ibid., Table 3-3 LPR Bit Functions, p. 3-8). How this is negotiated is not noted, but .%B CB-UNIX Source Code , .Pa cbunix7.pdf , pp. 64-72 .Pq Pa dz.c , bears: .Bd -literal -compact -offset 4n /* this array maps the standard unix transmit and receive speeds * into the speeds used int he dz11 hardware. If a speed is selected * that is not available on the dz11 it will be ignored. */ char dzspeed[] { 0000, /* not available */ 0000, /* 50 baud */ 0001, /* 75 baud */ 0002, /* 110 baud */ 0003, /* 134.5 baud */ 0004, /* 150 baud */ 0000, /* not available */ 0005, /* 300 baud */ 0006, /* 600 baud */ 0007, /* 1200 baud */ 0010, /* 1800 baud */ 0012, /* 2400 baud */ 0014, /* 4800 baud */ 0016, /* 9600 baud */ 0000, /* not available */ 0000, /* not available */ }; .Ed and, in .Fn dzparam : .Bd -literal -compact -offset 4n lpr = ((dzspeed[tp->t_speeds.lobyte]<<8) | ((dev.d_minor&07) | RECV_ON)); .Ed which is very obviously wrong: unmappable .Tn DH11 speeds all become .Sy 50 baud. .Pp The \*[doc-Xr-font]kl\fP (4) (\c .%B CB-UNIX Programmer's Manual , .Pa cbunix_man4.pdf , p. 6) .Pa ln00 name is "for historical reasons only": the canonical keying for "the real system console" is .Pa systty , and the current console if going single-user \(em "\fIInit\fP (1M) and \fIreboot\fP (1M) talk to this device" \(em is .Pa syscon , which \*[doc-Xr-font]telinit\fP (1M) links to the invoking teletype when passed runlevel .Sy S . .Pp This nomenclature is matched with .Xr line 1 .Pq ibid., Pa cbunix_man1_03.pdf Ns ,\& p. 100 \(em "get line identification" \(em which "gives the name of the user's line in the form \fBln\fP\fInn\fP in the range 00 to 99" (or "\fBlnxx\fP if the standard input file is not a typewriter"); the familiar .Xr tty 1 .Pq ibid., Pa cbunix_man1_09.pdf Ns ,\& p. 21 interface is also available, writing the full path and accepting .Fl s , as present-day. .Pp Opening \*[doc-Xr-font]tty\fP (4) "causes a wait to take place at the first read or write.", rather than waiting "until a connection is established.". The description for \fIraw\fP mode is extended; rather being "awakened on each character": .Bd -filled -compact -offset 4n Control is returned to the reading program only when the \fIread\fP (2) character count has been satisfied (as well as if an \fIalarm\fP (2) signal occurs, or if the line hangs up). .Ed And output parity, rather than being "generated" is noted as "all 8-bits are sent if parity is set to \fIeven\fP and \fIodd\fP and the number of data bits is set to 8.". Expectedly, in non-\fIraw\fP mode, output parity is no longer listed as being always-even, too. .Pp The .Sy start stop Ns -and-friends spiel is reproduced here entirely, but "A BREAK character is treated like and ESC character when not in raw mode." only; this makes sense. .Pp \*[doc-Xr-font]getty\fP (1M) .Pq ibid., Pa cbunix_man1_03.pdf Ns \&, p. 40 \(em .Qq the second process in the series, \fIinit-getty-login-shell,\fP that ultimately connects a terminal user with Tn UNIX \(em copies \*[doc-Xr-font]issue\fP (5) .Pq ibid., Pa cbunix_man5.pdf Ns \&, p. 32 to the calling teletype before the prompt, as present-day, and sees a primary .Sx SYNOPSIS of: .Bd -filled -compact -offset 4n \fB/etc/getty\fP [ \fB\-h\fP ] line [ speed [ type [ linedisc ] ] ] .Ed (Though "Additional arguments may be typed after the login name. These are passed to \fIlogin\fP, which will place them in the environment." \(em the latter is part of the .Nm login calling convention, the former is presumably mediated by just adding whitespace after the username.) .Pp .Fl h suppresses the default behaviour of forcing "a hangup on the line by setting the speed to zero before"hand. It's unclear how this is supposed to work with .Tn DZ11 Ns s , given the above (it is: it doesn't, see above and note that .Dv RECV_ON is .Sy 010000 (bit 12)). .Ar line is the filename under .Pa /dev , .Ar speed is the \*[doc-Xr-font]gettydefs\fP (5) (ibid., p. 26) entry, itself nothing more than the extraction of the built-in tables, and so tabulating the label, flags when reading the username .Pq with Sy hupcl \-echo raw No implied , final flags, speeds, the message, and the label to go to on BREAK. .Ar type describes "what type of terminal is connected to the line in question": .TS l4zw0 lb l lb l . none default tektonix\fR, \fPtek Tektronix tec TEC scope ds40-1 Teletype DS40-1 vt61 DEC vt61 hp45 Hewlett-Packard HP45 vt100 DEC vt100 ds40-2b Teletype DS40-2b .TE where "The default terminal is \fB\(Fcnone\(Fo\fP; i.e., any crt or normal terminal unknown to the system."; this is more akin to present-day .Ev $TERM .Pq coupled with Xr terminfo 5 , but as a first-class kernel layer, complete with emulating missing functions. And .Ar linedisc describes "which line discipline to use in communicating with the terminal": .TS l4zw0 lb l . full_duplex\fR, \fPfull default transparent\fR, \fPtrans transparent (see \fIioctl\fP(2)) half_duplex\fR, \fPhalf half duplex votrax votrax .TE "The default is \fB\(Fcfull_duplex\(Fo\fP, i.e., line discipline zero." .Pp The interesting differences in the username adaptation mode are: .Bd -filled -compact -offset 4n In addition to the standard UNIX erase and kill characters, '#' and '@', \fIgetty\fP also understands '\eb'. If the user uses a '\eb' as a rubout, getty sets the standard erase character to backspace and the standard kill character to '@' instead of '#' and '@'. .Ed Which is, notably, the worst possible way to spell this, and \fBHow To Get Started\fP continues to say .Qq The Tn ASCII No \(Fcdelete\(Fo (a.k.a. \(Fcrubout\(Fo) character , overloading it even further. .Pp And .Bd -filled -compact -offset 4n \fIGetty\fP also undertands the "standard" ESS protocols for erasing, killing and aborting a line, and terminating a line. If \fIgetty\fP sees the ESS erase character, '_', or kill character, '$', or abort character, '&', or the ESS line terminator, '/' or '!', it attempts to set up the terminal into \fBSTDTTY\fP mode (see \fIioctl\fP(2)), which has those characters as the erase, kill, and line terminator characters. If it doesn't succeed, the standard erase and kill characters will be used. .Ed Here, the .Tn ESS is the .Tn Electronic Switching System \(em .Tn AT&T Ns 's line of computerised telephone switches (cf.\& .%B UNIX History : "The system was derived from the UNIX operating system that was used in the SCCS (Switching Control Center System), which incidentally was the first application of UNIX outside of research."). This spelling (so far as .Sy _ , !\& (7:25) and .Sy $ (9:27)) is attested on the mostly-contemporaneous .Tn 3ESS \(em .Rs .%A Æstrid Smith .%A Sarah Autumn .%C 7000 East Marginal Way South, Seattle, WA 98108 .%D Mar 23, 2022 .%I Connections Museum Seattle .%R Booting up the 3ESS .\" https://youtu.be/k865-VjWUk8 .%U https://youtu.be/\:k865-VjWUk8 .Re .Pp The .Sx BUGS mention that none of the characters mentioned above (or "'^D'") is quotable. .Pp .Xr gtty 1 (\c .%B CB-UNIX Programmer's Manual , .Pa cbunix_man1_03.pdf , p. 58) appears, and bears recalling in its entirety: .Bd -filled -compact -offset 4n \fBNAME\fP .Bd -filled -compact -offset \w'\fBSEE\ AL\fP'u gtty \- get terminal line options .Ed \fBSYNOPSIS\fP .Bd -filled -compact -offset \w'\fBSEE\ AL\fP'u \fBgtty\fP [ line ... ] .Ed \fBDESCRIPTION\fP .Bd -filled -compact -offset \w'\fBSEE\ AL\fP'u \fIGtty\fP will get certain I/O options on the lines specified. If no line is given the standard input is used (file descriptor 0). See stty(1) for an explanation of the options reported by gtty. .Ed \fBSEE ALSO\fP .Bd -filled -compact -offset \w'\fBSEE\ AL\fP'u gtty(2), stty(1) .Ed \fBBUGS\fP .Bd -filled -compact -offset \w'\fBSEE\ AL\fP'u On devices which do not allow variable speeds, the input and output speed is meaningless. .Ed .Ed it follows, then, that .Xr stty 1 .Pq ibid., Pa cbunix_man1_08.pdf Ns ,\& p. 38 sees a pre-\c .%B Sixth Edition calling convention. In addition to the precise set of options in .%B Fourth Edition , a list of new options follows. .Pp .TS lb lb lb lb lb lx . Option Equiv. Description _ hdplx half duplex (disable reception during transmission) \-hdplx full duplex tstread test read (don't wait for carriage return to terminate read) \-tstread normal read termination hangup hupcl dial-up line (hangup after last close) \-hangup \-hupcl non dial-up lfdelay nl1\fR(?)\fP line-feed delay \-lfdelay nl0 no line-feed delay sccmod enable sccmode (special editing, break and del characters) \-sccmod disable sccmode xclude exclude future opens of this teletype \-xclude Allow future opens of this teletype tandemi ixon T{ respond to xoff and xon when transmitted by the terminal by stopping and starting output. T} \-tandemi \-ixon treat xoff and xon as normal input characters .TE .Oo Sy \- Oc Ns Sy tandemi are highlit in pink \(em the meaning of this is unclear; perhaps this is to indicate that they should be bolded and aren't? .Pp And these options, each taking a numeric argument: .TS l4zw0 lb l . speed allows the user to change the speed of a line stop \h'\w'allows the user to'u' specify the number of stop bits to be transmitted data \h'\w'allows the user to specify the number of'u' data bits vrow \h'\w'allows the user to'u' set the variable row on crts above which the screen will be frozen .TE The format for .Qq Sy speed is unspecified, and could be either the actual baud-rate just as well as .Bq Sy 0 , 15 . .Pp "the terminal type" may also be specified, but "If this is done it must be the first option."; depending on the system configuration, the following may be meaningful (this is implied to not be an exhaustive list): .Bd -filled -compact -offset 4n .ft B "none", "tec", "delta", "dta", "tektronix", "tex", "vt61", "ds40-1", "ds40-2b", "hp45" .ft P .Ed note that here .Tn Tektronix is spelled correctly, and its short form is .Qq Sy tex , not .Qq Sy tek . The .Tn VT100 is missing, and an unexplained .Qq Sy delta appears. .Pp "When a terminal type other than \fB\(Fcnone\(Fo\fP is in use, several more flags become valid:" .TS l4zw0 lb l . anl automatic new-line when character printed in column 80 \-anl no automatic new-line snl special new-line function (only implemented for \fB"ds40-1"\fP) \-snl no special new-line function lcf special action on last column of last line \-lcf no special action on last column of display default set terminal flags to default for this terminal type .TE .Pp .Xr stty:o 2 .Pq ibid., Pa cbunix_man2_04.pdf Ns ,\& pp. 23-28 \(em where the \*[doc-Xr-font]:o\fP denotes being for compatibility with "release 1 of CB-UNIX" .Pq Xr intro 2 Pq ibid., Pa cbunix_man2_01.pdf Ns ,\& Sx OLD C COMPILER , No p. 4 \(em is noted as superseded by .Xr ioctl 2 .Pq ibid., Pa cbunix_man2_02.pdf Ns ,\& pp. 1-7 but nevertheless contains a more cohesive overview of the system's general teletype system (though, notably, the mode layout and nomenclature outside of the core .Dv XTABS Ns - Ns Dv EVENP spectrum are completely different between the two). Line disciplines .Sy 1 , 2 are "reserved for project specific line disciplines", and .Bq Sy 5 , 9 "for future common line disciplines". Of those, .Sy 0 Pq Dv STD_LTYPE is the "normal" full-duplex discipline; .Sy 4 Pq Dv HF_LTYPE is the half-duplex line discipline \(em at last! \(em both of which "require no additional information". It's unclear how .Dv HF_LTYPE differs from setting .Dv HDPLX ("For those communicaitons controllers with the capability, disable reception during transmission."). .Pp The interesing discipline is .Sy 3 Pq Dv TRANS_LTYPE : .Bd -filled -compact -offset 4n a line discipline that allows the user full eight bit transparency ion input and output with or without parity, For this line discipline, a \fIwrite\fP will perform no mapping. A \fIread\fP will return upon the occurrence of the first of the three conditions as specified by the user: .ti +\w'w'u 1)\h'\w'ill r'u-\w'1)'u'The requested number of characters have arrived. .ti +\w'w'u 2)\h'\w'ill r'u-\w'2)'u'The number of seconds, \fIts_quanta\fP, has elapsed. .ti +\w'w'u 3)\h'\w'ill r'u-\w'3)'u'A break character has arrived. .br If \fIts_quanta\fP is zero, timing is disabled; otherwise, \fIts_quanta\fP is the maximum wait time in seconds. If \fIts_brk0\fP and \fIts_brk1\fP are both zero, no break characters will awaken the process. If \fIts_brk1\fP is 0377 then \fIts_bbrk0\fP is taken as a single break character. Otherwise, both break characters are assumed valid. \fBNCDELAY, XTABS, LCASE, ECHO, CRMOD, RAW, NTDELAY, NLDELAY, and STDTTY\fP have no meaning for this line discipline. .Ed Which is, to the precision of the temporal resolution and the explicit wake-up characters, .Em exactly the present-day .Sy raw mode. .Pp Backronymising, it may be that .Qq Oo Sy \- Oc Ns Sy tstread may actually be .Tn T Ns ran Ns Tn S Ns paren Ns Tn T READ , otherwise it's unclear what it .Em could be, aside maybe from a murky description of the equally-murky .Dv NOSLEEP : .Bd -filled -compact -offset 4n Return a zero if a read is performed and no characters are present. Don't wait to flush output on \fIclose\fP or \fIstty\fP. Don't wait for carrier in the first \fIread\fP or \fIwrite\fP after an \fIopen\fP if carrier is not up. Normally a process will block when waiting for carrier to come up after an \fIopen\fP. This roadblock will take place in the first \fIread\fP or \fIwrite\fP not the \fIopen\fP. .Ed .Pp .Xr stty:o 2 has an explicit .Dv NLDELAY mode, .Xr ioctl 2 has a range of .Dv CR Ns Bq Ar 0123 .Dv NL Ns Bq Ar 0123 .Dv TAB Ns Bq Ar 01 .Dv FF Ns Bq Ar 01 .Dv BS Ns Bq Ar 01 with the would-be .Dv TAB2 bit defined as .Dv NOAL ("no allocation", presumably), since .Dv XTABS is unmoved from .Sy 2 . .Qq Oo Sy \- Oc Ns Sy xclude corresponds directly to .Dv XCLUDE , described identically with addition of "Cleared upon last close.". .Pp .Dv TANDEMI ("response to xon/xoff", .Oo Sy \- Oc Ns Sy ixon ) is contrasted with .Dv TANDEMO .Pq but only in Xr ioctl 2 \(em "tranmission of xon/xoff": "turns off the keyboard when there are too many characters in the terminal hardware queue" \(em which itself is .Oo Sy \- Oc Ns Sy ixoff . .Pp .Sy erase kill are changeable, layout compatible with .%B Sixth Edition . No other character is, hence .Dv STDTTY , which is exactly as-described .Pq Sy erase Ar _ Sy kill Ar $ Sy eol Ar / Sy eol2 Ar !\& with the addition of .Sy icrnl and a proverbial .Qq Sy kill2 Ar & .Pq Em in addition No to the primary DEL (though, curiously, the flag itself does .Em not (appear to, .%B CB-UNIX Source Code , .Pa cbunix10.pdf , pp. 36-58 .Pq Pa tty.c , esp.\& .Fn ttyinput (p. 45); the manual itself would suggest it does) imply the .Sy erase kill keyings, so those need to be set separately). This is likely .Oo Sy \- Oc Ns Sy sccmod as .Tn S Ns witching Tn C Ns ontrol Tn C Ns enter Tn MOD Ns e . .Pp .Nm ioctl Ns Pq Dv DIOCSETT "is used to specify the type of CRT connected to a line": .Bd -literal -compact -offset 4n .ft R /* * Terminal types */ #define TERM_NONE 0 /* tty */ #define TERM_TEC 1 /* TEC Scope */ #define TERM_V61 2 /* DEC VT61 */ #define TERM_V10 3 /* DEC VT100 */ #define TERM_TEX 4 /* Tektronix 4023 */ #define TERM_D40 5 /* TTY Mod 40/1 */ #define TERM_H45 6 /* Hewlitt-Packard 45 */ #define TERM_D42 7 /* TTY Mod 40/2B */ .\" No Concept 100, it's only in some so its a later one :) .ft P .Ed "If a type other than \fBTERM_NONE\fP is specified, input and output mapping will occur for the CRT language defined in the header file \fB\fP. In this case, the ESC character takes on special meaning, escaping the subsequent characters on input and output." Helpfully, .Pa crtctl.h doesn't appear to have been scanned. Nevertheless, this points to a bizarre world where the motion/underlining/&c. interface is .Em to the system , which then provides a Cohesive Baseline Video Terminal, shimming as required. Mayhap it was less bizarre before the monopolisation of .Tn ECMA-48 ("Control functions for coded character sets") et al. \(em the only terminal listed verifiably supporing these is the .Tn VT100 . .Pp The video-terminal-specific modes are as such: .TS l4zw0 lb lx . TM_SNL Handle new line specially, if the terminal driver is so equipped. TM_ANL Provide a carriage return and new line when writing beyond column 80. TM_LCF T{ Immediately before placing a character in the last column and now, delete the top line, print the character in the last column of the now second-to-last-row, and then move the cursor to column one of the new last line. This function is requires for terminals that move the cursor to "bad" places when printing in the last position. T} TM_CECHO Echo the control sequences, such as "cursor up", when rewceived. TM_CINVIS Do not pass the cursor control characters to the user program on input. .TE And agree with .Qq Oo Sy \- Oc Ns Sy anl , .Qq Oo Sy \- Oc Ns Sy snl , and .Qq Oo Sy \- Oc Ns Sy lcf . .Pp .Qq Sy vrow is additionally noted as "for split screen operation". The actual semantics of this are unnoted. .Pp .Nm ioctl Ns Pq Dv VIOC Ns Oo Dv GS Oc Ns Dv ETD is described as "Get/set versatec parameters.". .Tn Votrax International, Inc.\& manufactured voice synthesisers, originally the .Tn VS4 \&"Votrax" , and is attested as discipline .Sy 5 Pq Dv VOT_LTYPE (\c .%B CB-UNIX Source Code , .Pa cbunix3.pdf , p. 95 .Pq Pa votrax.h ; ibid., .Pa cbunix10.pdf , pp. 65-69 .Pq Pa vs.c ) . .Pp .Em \&No use of .Dv TM_SNL is attested, especially in ibid., .Pa cbunix7.pdf , pp. 59-63 .Pq Pa ds40.c , which is supposed to host it. .Pp The lost-media .In sys/crtctl.h is also shed light upon via the emulation therein: .Bd -literal -compact -offset 4n char ds40map[] { LCA, NONE, /* Load Cursor Address (simulated) */ CUP, SDESC|'7', /* Move Cursor Up */ CDN, SDESC|'B', /* Move Cursor Down */ CRI, SDESC|'C', /* Move Cursor Right */ CLE, 010, /* Move Cursor Left */ NL, NONE, /* Special DS40 newline */ CRTN, SDESC|'G', /* Return Cursor to start of line */ HOME, SDESC|'H', /* Home Cursor */ CS, SDESC|'R', /* Clear Screen */ EEOP, SDESC|'J', /* Erase to end of page */ EEOL, NONE, /* Erase to end of line */ IL, SDESC|'L', /* Insert Line */ DL, SDESC|'M', /* Delete Line */ IC, SDESC|'^', /* Insert Char */ DC, SDESC|'P', /* Delete Char */ STB, SDESC|'3', /* Start Blink */ SPB, SDESC|'4', /* Stop Blink */ STAB, SDESC|'0', /* Set Single Tab */ ATAB, SDESC|'1', /* Set Column of Tabs */ CTAB, SDESC|'2', /* Clear Tabs */ USCRL, SDESC|'S', /* Scroll Up */ DSCRL, SDESC|'Y', /* Scroll Down */ ASEG, SDESC|'U', /* Advance Segment */ /* KBL, NONE, /* Keyboard Lock */ /* KBU, NONE, /* Keyboard Unlock */ UVSCN, NONE, DVSCN, NONE, 0, }; .Ed .Pp Where .Dv NL is handled as .Li \e33G\e33B , regardless of any mode. Mayhap it was optional in a previous version of the system? .Pp For comparison, for the .Tn VT100 (ibid., .Pa cbunix10.pdf , pp. 70-74 .Pq Pa vt100.c ) , the tables alone are at least twice that. .Pp A unique feature of .Tn CB-UNIX is .Nm ioctl Ns Pq Dv DIOCSETS : .Bd -filled -compact -offset 4n Set spy mode. All output directed to the termianal specified by \fIfildes\fP will be copied to the terminal of the process performing the \fIioctl\fP. Only one spy operation may be active in the entire system at any time. The spy continues until explicitly turned off. Currently, spy is only effective on lines using the \fBSTD_LTYPE\fP line discipline and is restricted to the super-user. .Ed It's unclear how the explicit turn-off is accomplished. . .Ss UNIX User's Manual, Release 3.0 Rattles off .Sy 110 , 150 , 300 No and Sy 1200 baud as "Common terminal speeds", with .Sy 2400 , 4800 , No and Sy 9600 "occasionally" available. The phone number spiel is generalised to .Bd -filled -compact -offset 4n On some .Tn UNIX systems, there are separate telephone numbers for each available terminal speed, while on other systems several speeds may be served by a single telephone number. .Ed and the itemised list of teletype speeds and how to handle them, depending on what the default is, to .Bd -filled -compact -offset 4n In the latter case, there is a "preferred" speed; if you dial in from a terminal set to a different speed, you will be greeded by a a string of meaningless characters (the \fBlogin:\fP message at the wrong speed. Keep hitting the "break" or "attention" key until the \fBlogin:\fP message appears. .Ed and likewise for the return/new-line post-login mapping tactics (rather, text lowered from the former \fI300-baud Terminals:\fP section is used verbatim; the note of preference for the new-line key where supported, previously part of the .Tn \fITELETYPE\(rg\fP Model 37 (and other terminals less than 300 baud):\& section, is lost) \(em .Rs .%A T. A. Dolotta .%A S. B. Olsson .%A A. G. Petruccelli .%B UNIX User's Manual .%C Murray Hill, NJ 07974 .%D June 1980 .%I Laboratory 364, Bell Telephone Laboratories, Incorporated .%N Release 3.0 .%O How To Get Started, \fBLogging in.\fP .%P p. 7 .\" http://bitsavers.org/pdf/att/unix/System_III/UNIX_Users_Manual_Release_3_Jun80.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_III/\:UNIX_Users_Manual_Release_3_Jun80.pdf .Re .Pp A record low of "two ways to log out" is recorded, by losing .Pf direct- Nm login (ibid., \fBLogging out.\fP). .Pp The "On .Tn CB-UNIX only" note rings true \(em .Sy ^ Ns Ar S Ns / Ns Sy ^ Ns Ar Q are the only flow control method, but now in .Sy ixany mode (ibid., \fBHow to communicate through your terminal.\fP, para. 4). .Pp The individual drivers are rich: .Xr dj 4 (ibid., p. 560) for .Tn DJ11 Ns s (all together now: incessantly called "DJ-11"s) \(em "Line speeds and other characteristics are not programmable but are set by switches in the hardware in groups of 4 lines. Only parameters such as character delays and mapping can be altered."\(dg \(em .Xr dz 4 (ibid., p. 566) for .Tn DZ11 Ns s .Pq Nm dz , .Tn DZ11/KMC11 Ns s .Pq Nm dzk , and .Tn DH11 Ns s .Pq Nm dh (yes.\&) \(em the .Tn DZ11 note is exactly the same as on .Tn CB-UNIX ; "The behavior of \fIdzk\fP lines is indistinguishable from that of \fIdz\fP lines, except that on the \fIdzk\fP backspace delays are implemented using fill characters (rubouts) instead of timed delays.", which corresponds to hard .Oo Sy \- Oc Ns Sy ofill based on the driver\(dd; "Note that the .Tn DH-11 is considered obsolete and is not supported on the VAX-11/780." \(em same old .Xr kl 4 (ibid., p. 571), though marked \fB(PDP-11 only)\fP in the header \(em on .Pa /dev/console , "Since they run at a constant speed, attempts to change the speed are ignored.". .Pp .Xr init 8 (ibid., p. 681) distinguishes entries by arbitrary .Brq Ar state , id , with no relation to line state; if no .Pa /etc/inittab .Pq Xr inittab 5 , ibid., p. 618 is present or .Nm init is the only process, it runs a shell on .Pa /dev/console \(em this is described as more of a rescue state than a distinct single-user mode. .Pp .Xr getty 8 (ibid., p. 674) sees a .Sx SYNOPSIS of .Bd -filled -compact -offset 4n \fB/etc/getty\fP name type delay .Ed since it now opens the line itself \(em "\fIName\fP should be the name of a termianl in \fB/dev/\fP (e.g., \fBtty03\fP)." \(em and "\fIdelay\fP is relevant for dial-up ports only. It specifies the time in seconds that should elapse before the port is disconnected if the user does not respond to the \fBlogin\fP request.". .Pp The text itself is a generalisation of the .%B Sixth Edition into a mimickry of the .%B Seventh Edition format. Rather than just the "Terminet 300 terminal" being put in full-duplex by the "login:" messages, they may additionally "take the .Tn DASI terminals out of the plot mode, or put a TELETYPE\(rg Model 37 into full-duplex.". Returning "the GSI terminal to non-graphic mode" is lost. .Pp The .Ar type table is compiled-in, but this is, at least, listed in the .Sx BUGS . A special (undisclaimed with the "(may vary locally)" for the others) type of .Sq Sy \&! .Ar type "tells \fIgetty\fP to update \fB/etc/utmp\fP and exit". What this update does is unspecified. The .Ar type Ns s recognised in the distribution .%B Release 3.0 are: .TS l4zw0 lb lx . \- B110; for 100 baud console \*[doc-Tn-font-size]TTY\s0. 0 B300\-B150\-B110\-B1200; normal dial-up sequence starting at B300. 1 B150; no sequence. 2 B2400; no sequence. 3 B1200\-B300\-B150\-B110; normal dial-up sequence starting at B1200. 4 B300; for console \*[doc-Tn-font-size]DECwriter\s0. 5 B9600; no sequence. 6 B4800\-B9600; for Tektronix 4014. .TE .Pp The source itself is derived from .%B Sixth Edition .\" The crucial difference from V6-V7 is turning '0'-1-2 into '0'-1-2-3 — SysIII turns '0'-1-2 into '0'-1-2-'3' .\" to put it another way: the diff from V7 to SysIII reverts the V6-V7 hunk (provided to me by my good friend Juliano: .Rs .%O \*[doc-Pa-font]src/cmd/getty.c\fP .%R UNIX System III Source Code .\" https://vetusware.com/download/UNIX%20System%20III%20Source%20Code%20SYSIII/?id=11576 .%U https://vetusware.com/\:download/\:UNIX%20System%20III%20Source%20Code%20SYSIII/\:?id=11576 .Re Don't be a cop if you're affiliated with whoever bought the rights from SCO Group) and modes .Sq Sy \- and .Sq Sy 1 agree completely, the .Sq Sy 0 loop is extended with the .Sy 1200 Ns -baud mode, and the new .Sq Sy 3 just starts there, the .Sq Sy 2 .Sy 9600 Ns -baud mode is replaced, all up from there is new. .Pp The .Xr utmp 5 (\c .%B Release 3.0 , p. 631) processing is done as the first thing and consists of setting the entry for .Ar name to {current-time, \(es} in .Pa /etc/utmp and appending the same to .Pa /usr/adm/wtmp . .Pp .Ar name is ignored if the standard input stream is a teletype, and the name of the attached teletype used instead; this is, presumably, to be used in conjunction with .Sq Sy \&! , explained as .Bd -literal -compact -offset 4n /* If the term type arg is special, exit only, this is so you can update utmp without spawning an open line */ .Ed which does just exit. Timing out on .Ar delay (if specified and non-zero) hangs up the line bimodally by setting it to .Dv B0|HUPCL and exiting. Some .Sx Special Control Characters are set to their defaults \(em .Sy intr Ar 0177 .Sy quit ^ Ns Ar \e ("/* FS, cntl | */") .Sy erase Ar # .Sy kill Ar @ .Sy eof Ar ^ Ns Ar D .Sy eol Ar 00 \(em from .In termio.h .Pq ibid., Pa src/head/termio.h , under the present-day .Dv V Ns -prefixed indices and .Dv C Ns -prefixed default macros no less! .Pp .Xr tty 4 (\c .%B Release 3.0 , pp. 585-592) sees, fore-mostly, a fleshed-out controlling teletype and process group system: .Pa /dev/tty is "a synonym for the control terminal associated with the process group of that process, if any", and "The very first terminal file opened by the process group leader of a terminal file not already associated with a process group becomes the \fIcontrol terminal\fP of that process group,", "A process can break this association by changing its process group using \fIsetpgrp\fP(2)." \(em this corresponds .Em directly to final present-day semantics and this is where nigh-ubiquitous techniques like double-forked daemonisation take their root. .Pp "A line is delimited by a new-line .Pq Tn ASCII LF character, an end-of-file .Pq Tn ASCII EOT character, or an end-of-line character." \(em this fore-shadows an almost-normal interface, but one would be remiss to not note that EOT is .Tn E Ns nd Tn O Ns f Tn T Ns ransmission , hence why it wouldn't be outlandish for a teletype to hang up on its receipt. .Pp .Sq Sy @ "optionally outputs a new-line character."\& and the table of "Certain characters" is re-tagged in terms of the logical actions, rather than the raw (now-default) values, and includes all characters with special meaning: .TS l4zw0 l lx . INTR T{ (rubout or \*[doc-Tn-font-size]ASCII DEL\s0) [same text as .%B Seventh Edition , incl. its all-processes-with-this-controlling-terminal target]) T} QUIT T{ (Control-| or \*[doc-Tn-font-size]ASCII FS\s0) [likewise, though the core-dump filename is expounded] T} ERASE T{ (#) erases the preceding character. It will not erase beyond the start of a line, as delimited by a \*[doc-Tn-font-size]NL\s0, \*[doc-Tn-font-size]EOF\s0, or \*[doc-Tn-font-size]EOL\s0 character. T} KILL (@) deletes the entire line, as delimited by a \*[doc-Tn-font-size]NL\s0, \*[doc-Tn-font-size]EOF\s0, or \*[doc-Tn-font-size]EOL\s0 character. EOF (Control-d or \*[doc-Tn-font-size]ASCII EOT\s0) [likewise] EOL T{ (\*[doc-Tn-font-size]ASCII NUL\s0) is an additional line delimiter, like \*[doc-Tn-font-size]NL\s0. It is not normally used. T} STOP T{ (Control-s or \*[doc-Tn-font-size]ASCII DC3\s0) can be used to temporarily suspend output. It is useful with \*[doc-Tn-font-size]CRT\s0 terminals to prevent output from disappearing before it can be read. Wile output is suspended, STOP characters are ignored and not read. T} START T{ (Control-q or \*[doc-Tn-font-size]ASCII DC1\s0) is used to resume output which has been suspended by a STOP character. While output is not suspended, START characters are ignored and not read. The start/stop characters can not be changed or escaped. T} .TE The observant reader will note that .Pq sans Dv NL , these correspond directly to .Dv V Ns -prefixed indices, Additionally, "The character values for .Tn INTR, QUIT , ERASE , KILL , EOF , and .Tn EOL may be changed to suit invividual tastes. The .Tn ERASE , KILL , and .Tn EOF characters may be escaped by a preceding \e character, in which case no special function is done." This .Dv EOF handling is appears to be unique. No trimming of EOT on output is done. .Pp .In sgtty.h as the container for the structure used by the "primary calls" .In termio.h : .Bd -literal -compact -offset 4n .ie n \{ . #define NCC 8 struct termio { unsigned short c_iflag; /* input modes */ unsigned short c_oflag; /* output modes */ unsigned short c_cflag; /* control modes */ unsigned short c_lflag; /* local modes */ char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control chars */ }; \} .el \{ .ft R #define NCC 8 struct termio { unsigned short c_iflag; /* input modes */ unsigned short c_oflag; /* output modes */ unsigned short c_cflag; /* control modes */ unsigned short c_lflag; /* local modes */ char c_line; /* line discipline */ unsigned char c_cc[NCC]; /* control chars */ }; .ft P \} .Ed "The special control characters are defined by the array \fIc_cc\fP. The relative positions and initial values for each function are as follows:" .TS l4zw0 l l l . 0 INTR DEL 1 QUIT FS 2 ERASE # 3 KILL @ 4 EOF EOT 5 EOL NUL 6 reserved 7 reserved .TE This is the origin of the phrase .Qq Sx Special Control Characters , and, more importantly, .Vt "struct termio" is pretty much exactly as present-day, and so are the indices (mostly, see below). .br "The \fIc_iflag\fP field describes the basic terminal input control", and is outlined below. .Pp .TS lfCI lb lb lfCR lb l . c_iflag Equiv. Description _ IGNBRK ignbrk Ignore break condition. BRKINT brkint Signal interrupt on break. IGNPAR ignpar Ignore characters with parity errors. PARMRK parmrk Mark parity errors. INPCK inpck Enable input parity check. ISTRIP istrip Strip character. INLCR inlcr Map \*[doc-Tn-font-size]NL\s0 to \*[doc-Tn-font-size]CR\s0 on input. IGNCR igncr Ignore \*[doc-Tn-font-size]CR\s0 cr. ICRNL icrnl Map \*[doc-Tn-font-size]CR\s0 to \*[doc-Tn-font-size]NL\s0 on input. IUCLC iuclc Map upper-case ot lower-case on input. IXON ixon Enable start/stop output control. IXANY ixany Enable any character to restart output. IXOFF ixoff Enable start/stop input control. .TE .Pp The attentive reader may note that these are .Em all as present-day, sans the lack of foreground/background process groups .Pq signals are targeted as for Dv SIGINT and .Dv START Ns / Ns Dv STOP always being stripped from the input .Pq nowadays they're passed through if not Dv IXON . The less-obvious flags are described below the original table; they are mostly found with mildly-evolved wording in .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 , where .Dv IUCLC is lost. "The initial input control value is all bits clear.". .br "The \fIc_oflag\fP field specifies the system treatment of output", and is outlined below. .Pp .TS lfCI lb lb lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR lb l lfCR nb l . c_oflag Equiv. Description _ OPOST opost Postprocess output. OLCUC olcuc Map lower case to upper on output. ONLCR onlcr Map \*[doc-Tn-font-size]NL\s0 to \*[doc-Tn-font-size]CR-NL\s0 on output. OCRNL ocrnl Map \*[doc-Tn-font-size]CR\s0 to \*[doc-Tn-font-size]NL\s0 on output. ONOCR onocr No \*[doc-Tn-font-size]CR\s0 output at column 0. ONLRET onlret \*[doc-Tn-font-size]NL\s0 performs \*[doc-Tn-font-size]CR\s0 function. OFILL ofill Use fill characters for delay. OFDEL ofdel Fill is \*[doc-Tn-font-size]DEL\s0, else \*[doc-Tn-font-size]NUL\s0. = NLDLY \fR(mask)\fP Select new-line delays: NL0 nl0 NL1 nl1 .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& CRDLY \fR(mask)\fP Select carriage-return delays: CR0 cr0 CR1 cr1 CR2 cr2 CR3 cr3 \ \& TABDLY \fR(mask)\fP Select horizontal-tab delays: TAB0 tab0 TAB1 tab1 TAB2 tab2 TAB3 tab3 Expand tabs to spaces. \ \& BSDLY \fR(mask)\fP Select backspace delays: BS0 bs0 BS1 bs1 \ \& VTDLY \fR(mask)\fP Select vertical-tab delays: VT0 vt0 VT1 vt1 \ \& FFDLY \fR(mask)\fP Select form-feed delays: FF0 ff0 FF1 ff1 .TE .Pp They just don't miss! In .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1, .Dv OPOST is the only truly portable flag, all others are shaded XSI (X/Open Systems Interfaces \(em extension), and, symmetrically, .Dv OLCUC is lost (\c .%B Release 3.0 even points out that "This function is often used in conjunction wiht \*[doc-Tn-font-size]IUCLC\s0."). The .Em entire description for the now-XSI parts lives .Em verbatim in the standard. "The initial output control value is all bits clear.". .br "The \fIc_cflag\fP field specifies the hardware control of the terminal", and is outlined below. .TS lfCI lb lb lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR nb l lfCR lb l . c_cflag Equiv. Description _ CBAUD \fR(mask)\fP Baud rate: B0 0 Hang up B50 50 50 baud B75 75 75 baud B110 110 110 baud B134 134 134.4 baud B150 150 150 baud B200 200 200 baud B300 300 300 baud B600 600 600 baud B1200 1200 1200 baud B1800 1800 1800 baud B2400 2400 2400 baud B4800 4800 4800 baud B9600 9600 9600 baud EXTA exta External A EXTB extb External B .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& CSIZE \fR(mask)\fP Character size: CS5 cs5 5 bits CS6 cs6 5 bits CS7 cs7 6 bits CS8 cs8 7 bits = CSTOPB cstopb Send two stop bits, else one. CREAD cread Enable receiver. PARENB parenb Parity enable. PARODD parodd Odd parity, else even. HUPCL hupcl Hang up on last close. CLOCAL clocal Local line, else dial-up. .TE .Pp "For any particular hardware, impossible speed changes are ignored.", and note that this is a global .Pq RX Em and No TX speed \(em this further supports the hypothesis that no-one has ever actually used uneven speeds. .Pp The same deal as for .Fa c_iflag applies; the speeds are a separate table with specialised setters (see below), but are otherwise identical, except .Dv EXTA , .Dv EXTB are spelled as .Dv B19200 , .Dv B38400 with the expected descriptions; .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 has an additional explicit side-effect for .Dv CLOCAL as functioning as-if .Dv O_NONBLOCK : this is attested in the drivers and makes logical sense, but not laid forth. "The initial hardware control value after open is B300, CS8, \*[doc-Tn-font-size]CREAD\s0, \*[doc-Tn-font-size]HUPCL\s0.". .br "The \fIc_lflag\fP field of the argument structure is used by the line discipline to control terminal functions. The basic line discipline (0) provides" flags outlined below. .Pp .TS lfCI lb lb lfCR lb l . c_cflag Equiv. Description _ ISIG isig Enable signals. ICANON icanon Canonical input (erase and kill processing). XCASE xcase Canonical upper/lower presentation. ECHO echo Enable echo. ECHOE echoe Echo erase character as \*[doc-Tn-font-size]BS-SP-BS\s0. ECHOK echok \-echoke Echo \*[doc-Tn-font-size]NL\s0 after kill character. ECHONL echonl Echo \*[doc-Tn-font-size]NL\s0. NOFLSH noflsh Disable flush after interrupt or quit. .TE .Pp Same deal here, but this is the first field that's missing flags found in .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 .Pq Dv IEXTEN Ns " and" Dv TOSTOP . .Dv ISIG is, naturally, not yet .Dv SUSP Ns -capable . The standard defines .Dv ECHOE as its function \(em erasing the last character \(em rather than the output sequence. .Dv ECHOK is allowed to do either .Oo Sy \- Ns Oc Sy echoke mode \(em this system reasonably does .Sy \-echoke since it doesn't have the flag. .Dv XCASE is lost. .Pp The only weirdness here is that in the .Li !\& Ns Dv ECHO ECHOE case, in .%B Release 3.0 .Qq the erase character is echoed as Tn ASCII SP BS . It also says "Note that an escape character preceding the erase or kill character removes any special function." (and likewise for EOT); this is allowed for in modern standards, cf.\& .Sx IEEE Standard Portable Operating System Interface for Computer Environments, Approved August 22, 1988 . .Dv ECHONL is noted to be "useful for terminals set to local echo (so-called half duplex).". "The initial line-discipline control value is all bits clear.". .Pp The "lost" flags all last appear in .St -susv2 and are only defined for the .Dv POSIX locale. This is a bit of an issue when the kernel has to process them (alternatively, .Qq mangle my preferred non-seven-bit- Ns Tn ASCII No encoding ) . .Pp The .Dv ISIG "special input functions may be disabled individually by changing the value of the control character to an unlikely or impossible value (e.g. 0377).". Admittedly, the common spelling is .Dv _POSIX_VDISABLE nowadays, and that value is usually handled explicitly, but yeah. There's also nothing preventing this working from other remappable values in .Dv ICANON , this is likely just suboptimal phrasing location. .Pp .Qq The Tn MIN No and Tn TIME No values are stored in the position for the Tn EOF No and Tn EOL No characters respectively.\& , and to this day .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 requires that indices for all .Sx Special Control Characters are unique, "except that the VMIN and VTIME subscripts may have the same values as the VEOF and VEOL subscripts, respectively.". .Pp Quite funnily, there is a marked .Em loss of function against .%B Seventh Edition , since .Dv START and .Dv STOP can't be remapped. There is also a provision for this (but a lesser one, in that they may just be ignored when setting, but must be otherwise provided). .Pp Admittedly, there is also a loss of .Fn ioctl Ns s : since all parameters are integrated into one complete package, the .Vt "struct tchars" .Dv TIOC Ns Oo Dv GS Oc Ns Dv ETC requests are lost entirely, the new spellings .Pq well, the old ones are still supported as In sys/ttold.h No compat shims , but .TS l4zw0 n2fCR lx . TIOCGETP\fR\(->\fP\&TCGETA T{ Get the parameters associated with the terminal and store it in the\fItermio\fP structure referenced by \fBarg\fP. T} TIOCSETN\fR\(->\fP\&TCGETA T{ Set the parameters associated with the terminal from the structure referenced by \fBarg\fP. The change is immediate. T} \&TCSETAW T{ Wait for the otput to drain before setting the new parameters. This form should be used when changing parameters what will affect output. T} TIOCSETP\fR\(->\fP\&TCGETAF T{ Wait for the output to drain, then flush the input queue and set the new parameters. T} .TE .Pp .Dv TIOCHPCL is removed, since it's once again provided by .Dv HUPCL . .Pp The system ships with only one line discipline, .Sy 0 , imaginatively branded .Bd -literal -compact -offset 4n /* * Line discipline 0 */ .Ed .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 says in its .Nm .Sx RATIONALE : .Bd -filled -compact -offset 4n The original \fIstty\fP description was taken directly from System V and reflected the System V terminal driver \fBtermio\fP. It has been modified to correspond to the terminal driver \fBtermios\fP. .Ed But this doesn't appear to be supported by either the source or the manual itself \(em "termio" is just the .Qq terminal Fn ioctl argument and its declaration and arguments live in an eponymous header. This is like calling the pre-\c .%B Release 3.0 .Pa tty.c .Qq the Tn UNIX Sy sgtty No driver . Parameterising it differently (hell, not even that much against .%B Seventh Edition , if anything the driver is simpler) and putting the discipline-specific routines into .Pa tt0.c didn't really make it .Em different . "the terminal driver \fBtermios\fP" is also .Em literally just .%B Release 3.0 .Xr tty 4 plus insubstantial wording fiddling to make it \fBs\fPstandard. To a .Em staggering degree. .Pp A "synchronous terminal interface" is included as .Xr st 4 (ibid., p. 582), described as .Qq a pseudo-device driver that enables a Tn UNIX No system to communicate with a Tn TELETYPE\(rg No Model 40/0 Tn ASCII No synchronous terminal.\& utilising .Xr vpm 4 ("The Virtual Protocol Machine"; ibid., 594), itself a .Tn KMC11 (this time spelled correctly) driver and compiler toolchain that .Qq translates a high-level language description protocol into an intermediate language that is interpreted by an interpreter running in the Tn KMC11 Ns .\& \(em this machinery is entirely unrelated to the teletype driver and line disciplines, and driven entirely from user-space (though a default is provided the, cf.\& .Xr st 1M (ibid., p. 343) and .%B UNIX System III Source Code .Pa src/cmd/st/ , in particular .Pa mod40.r therein; the corresponding .Xr st 4 driver lives in .Pa src/uts/pdp11/pwb/st.c and .Pa src/uts/vax/pwb/st.c , the former branded "Synchronous terminal interface for the PDP 11." and the port "TTY 40/4 driver for VAX 11/780"). .Pp .Xr ioctl 2 (\c .%B Release 3.0 , p. 446) is a stub even more so than the .%B Seventh Edition one, giving only the prototype and errors. .Pp .Xr login 1 (\c .%B Release 3.0 , p. 240) \(em "sign on" \(em is delightfully uneventful; passphrases may now expire, delightfully termed "password aging", and the "\(Fcdialup\(Fo password" becomes "a second \(Fcexternal\(Fo password", with a prompt of "External security:", and "If you do not complete the login successfully within a certain period of time (e.g., one minute), you are likely to be silently disconnected.", which goes hand-in-hand with .Nm getty Ns 's .Ar delay . .Pp .Xr stty 1 (ibid., pp, 348-350) sees a .Sx SYNOPSIS of .Bd -filled -compact -offset 4n \fBstty\fP [ \fB\-a\fP ] [ \fB\-g\fP ] [ options ] .Ed and switches to using "the device that is the current standard input" (as opposed to output, and more a saner description). Without .Fl ag , "settings of certain options" are reported; with .Fl a , "all of the option settings", and with .Fl g , "current settings in a form that can be used as an argument to another \fIstty\fP command." \(em the options are fully formed here, and the output is directed to the standard output stream. .Pp It's odd that this is the first system noting that "many combinations of the options make no sense, but no sanity checking is performed". The settable options follow. \(<- indicates the argument is identical to present-day (\(lA with notes); \(-> indicates the description is the same as in .%B Seventh Edition (to the precision of whitespace, punctuation, and link to .Xr tty 4 ) . .Pp .TS l1b s1 lb lb l lx lb l l lb l l lb l l lb s s lb l l . Control Modes Description _ parenb (\-parenb) \(<- enable (disable) parity generation and detection. parodd (\-parodd) \(<- select odd (even) parity. cs5 cs6 cs7 cs8 \(<- select character size (see \fItty\fP(4)). 0 \(<> hang up phone line immediately. 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 exta extb \(<> T{ Set terminal baud rate to the number given, if possible (these are the speeds supported by the \*[doc-Tn-font-size]DH-11\s0 interface). T} hupcl (\-hupcl) \(<- hang up (do not hang up) \*[doc-Tn-font-size]DATA-PHONE\(rg\s0 connection on last close. hup (\-hup) \(<- same as \fBhupcl\fP (\fB\-hupcl\fP). cstopb (\-cstopb) \(<- use two (one) stop bits per character. cread (\-cread) \(<- enable (disable) the receiver. clocal (\-clocal) \(<- assume a line without (with) modem control. .TE .sp .TS l1b s1 lb lb l lx . Input Modes Description _ ignbrk (\-ignbrk) \(<- ignore (do not ignore) break on input. brkint (\-brkint) \(<- signal (do not signal) \*[doc-Tn-font-size]INTR\s0 on break. ignpar (\-ignpar) \(<- ignore (do not ignore) parity errors. parmrk (\-parmrk) \(<- mark (do not mark) parity errors (see \fItty\fP(4)). inpck (\-inpck) \(<- enable (disable) input parity checking. istrip (\-istrip) \(<- strip (do not strip) input characters to seven bits. inlcr (\-inlcr) \(<- map (do not map) \*[doc-Tn-font-size]NL\s0 to \*[doc-Tn-font-size]CR\s0 on input. igncr (\-igncr) \(<- ignore (do not ignore) \*[doc-Tn-font-size]CR\s0 on input. icrnl (\-icrnl) \(<- map (do not map) \*[doc-Tn-font-size]CR\s0 to \*[doc-Tn-font-size]NL\s0 on input. iuclc (\-iuclc) \(lA map (do not map) upper-case alphabetics to lower case on input. ixon (\-ixon) \(<- T{ enable (disable) \*[doc-Tn-font-size]START/STOP\s0 output control. Output is stopped by sending an \*[doc-Tn-font-size]ASCII DC3\s0 and started by sending an \*[doc-Tn-font-size]ASCII DC1\s0 . T} ixany (\-ixany) \(<- allow any character (only \*[doc-Tn-font-size]DC1\s0) to restart output. ixoff (\-ixoff) \(<- T{ request that the system send (not send) \*[doc-Tn-font-size]START/STOP\s0 characters when the input queue is nearly empty/full. T} .TE .sp .TS l1b s1 lb lb l lx . Output Modes Description _ opost (\-opost) \(<- post-process output (do not post-process output; ignore all other output modes). olcuc (\-olcuc) \(<- map (do not map) lower-case alphabetics to upper case on output. onlcr (\-onlcr) \(<- map (do not map) \*[doc-Tn-font-size]NL\s0 to \*[doc-Tn-font-size]CR-NL\s0 on output. ocrnl (\-ocrnl) \(<- map (do not map) \*[doc-Tn-font-size]CR\s0 to \*[doc-Tn-font-size]NL\s0 on output. onocr (\-onocr) \(<- do not (do) output \*[doc-Tn-font-size]CR\s0s at column zero. onlret (\-onlret) \(<- on the terminal \*[doc-Tn-font-size]NL\s0 performs (does not perform) the \*[doc-Tn-font-size]CR\s0 function. ofill (\-ofill) \(<- use fill characters (use timing) for delays. ofdel (\-ofdel) \(<- fill characters are \*[doc-Tn-font-size]DEL\s0s (\*[doc-Tn-font-size]NUL\s0s). cr0 cr1 cr2 cr3 \(<> select style of delay for carriage returns (see \fItty\fP(4)). nl0 nl1 \(<- select style of delay for line-feeds (see \fItty\fP(4)). tab0 tab1 tab2 tab3 \(<- select style of delay for horizontal tabs (see \fItty\fP(4)). bs0 bs1 \(<> select style of delay for backspaces (see \fItty\fP(4)). ff0 ff1 \(<> select style of delay for form-feeds (see \fItty\fP(4)). vt0 vt1 \(<- select style of delay for vertical tabs (see \fItty\fP(4)). .TE .sp .TS l1b s1 lb lb l lx . Local Modes Description _ isig (\-isig) \(lA T{ enable (disable) the checking of characters against the special control characters \*[doc-Tn-font-size]INTR\s0 and \*[doc-Tn-font-size]QUIT\s0. T} icanon (\-icanon) \(<- enable (disable) canonical input (\*[doc-Tn-font-size]ERASE\s0 and \*[doc-Tn-font-size]KILL\s0 processing). xcase (\-xcase) \(<- canonical (unprocessed) upper/lower-case presentation. echo (\-echo) \(<- echo back (do not echo back) every charactet typed. echoe (\-echoe) \(lA T{ echo (\-echo) (do not echo) \*[doc-Tn-font-size]ERASE\s0 cahracter as a backspace-space-backspace string. Note: this mode will erase the \*[doc-Tn-font-size]ERASE\s0ed character on many \*[doc-Tn-font-size]CRT\s0 terminals; however, it does \fInot\fP keep track of column position and, as a result, may be confusing on escaped characters, tabs, and backspaces. T} echok (\-echok) \(lA echo (do not echo) \*[doc-Tn-font-size]NL\s0 after \*[doc-Tn-font-size]KILL\s0 character. lfkc (\-lfkc) the same as \fBechok\fP (\fB\-echok\fP); obsolete. echonl (\-echonl) \(<- echo (do not echo) \*[doc-Tn-font-size]NL\s0. noflsh (\-noflsh) \(<- disable (enable) flush after \*[doc-Tn-font-size]INTR\s0 or \*[doc-Tn-font-size]QUIT\s0. .TE .sp .TS l1b s1 lb lb l lx lb l l lb s s lb l l lb s s lb l l lb l l lb l l lb l l lb s s lb l l lb l l lb l l lb l l li l l . Combination Modes Description _ evenp\fR or \fPparity \(lA enable \fBparenb\fP and \fBcs7\fP. oddp \(<- enable \fBparenb\fP, \fBcs7\fP, and \fBparodd\fP. \-parity\fR, \fP\-evenp\fR, or \fP\-oddp \(<- disable \fBparenb\fP, and set \fBcs8\fP. raw (\-raw\fR or \fPcooked) T{ enable (disable) raw input and output (no \*[doc-Tn-font-size]ERASE\s0, \*[doc-Tn-font-size]KILL\s0, \*[doc-Tn-font-size]INTR\s0, \*[doc-Tn-font-size]QUIT\s0, \*[doc-Tn-font-size]EOT\s0, or output post processing). T} nl (\-nl) \(<- T{ unset (set) \fBicrnl\fP, \fBonlcr\fP. In addition \fB\-nl\fP unsets \fBinlcr\fP, \fBigncr\fP, \fBocrnl\fP, and \fBonlret\fP. T} lcase (\-lcase) \(<- set (unset) \fBxcase\fP, \fBiuclc\fP, and \fBolcuc\fP. LCASE (\-LCASE) \(<- same as \fBlcase\fP (\fB\-lcase\fP). tabs (\-tabs\fR or \fPtab3) \(<- preserve (expand to spaces) tabs when printing. ek \(lA set \*[doc-Tn-font-size]ERASE\s0 and \*[doc-Tn-font-size]KILL\s0 characters back to normal \fB#\fP and \fB@\fP. sane resets all modes to some reasonable values. term T{ set all modes suitable for the terminal type \fIterm\fP, where \fIterm\fP is one of \fBtty33\fP, \fBtty37\fP, \fBvt05\fP, \fBtn300\fP, \fBti700\fP, or \fBtek\fP. T} .TE .Pp The .Qq Sy 134.5 spelling of .Qq Sy 134 is retained, but undocumented. .br .Qq Tn DATA-PHONE\(rg is a line of Bell modems. The only spelling change from .Qq Oo Sy \- Oc Ns Sy hup being trademarkisation of "dataphone" is, well. .br .Oo Sy \- Oc Ns Sy iuclc is predicated on .Sy iexten since its loss in .St -susv3 . .br .Qq Oo Sy \- Oc Ns Sy lfkc is the only psycho mode here. There's never been any mention of it anywhere before. .br .Qq Oo Sy \- Oc Ns Sy isig is the same to the precision of .%B Release 3.0 not having job control. Modern .Oo Sy \- Oc Ns Sy echoe implementations are usually smarter than described and .Em do process tabs normally, and .Sy \e Ns -escaping is thankfully lost. Embedded backspaces in .Sy \-echoctl mode are usually sufficiently confusing, though. .br .Qq Sy echok corresponds to .Sy echok \-echoke mode. .br .Qq Sy evenp and .Qq Sy parity are documented as .Sy parenb cs7 but are actually also .Sy \-parodd , so as present-day. .br .Qq Sy ek uses .Dv CERASE and .Dv CKILL macros, so it is the same, but the system defaults are different. .br .Qq Sy sane is .Sy \-ignbrk brkint ignpar \-parmrk \-inpck istrip \-inlcr \-igncr icrnl \-iuclc ixon \-ixoff opost \-olcuc onlcr \-ocrnl \-onocr \-onlret \-ofill \-ofdel nl0 cr0 tab0 bs0 ff0 vt0 cs7 cread parenb \-parodd \-clocal isig icanon \-xcase echo \-echoe echok \-echonl \-noflsh and all .Sx Special Control Characters default. This corresponds to, going from .%B Release 3.0 to present-day, a loss of .Sy ignpar \-parmrk \-inpck istrip ixon cs7 parenb \-parodd \-clocal \-echoe and gain of .Sy \-ixany imaxbel \-iutf8 echoe echoke \-tostop echoctl \-echoprt \-flusho iexten \-extproc . .br The .Ar term Ns s are the same as in .%B Seventh edition , but the short forms are lost. .br Due to the .Dv VMIN Ns / Ns Dv VTIME .Dv VEOF Ns / Ns Dv VEOL overlap, .Qq Sy raw (all .Sx Input Attributes clear, .Sy \-opost cs8 \-parenb \-isig \-icanon \-xcase ) sets .Sy min Ar 1 .Sy time Ar 1 (or, since no parsing provisions are made for .Sy min time , .Qq Sy min ^ Ns Ar A Ns \& Sy time ^ Ns Ar A ) .Qo Sy \-raw Qc Ns / Ns Qq Sy cooked .Pq Sy brkint ignpar istrip icrnl ixon opost cs7 parenb isig icanon set .Sy eof eol to default. The latter two .Pq sans Sy cs7 is as present-day. .Pp The .Sx Control Assignments table reads, for "\fIcontrol-character c\fP": .Bd -filled -compact -offset 4n set \fIcontrol-character\fP to \fIc\fP, where \fIcontrol-character\fP is \fBerase\fP, \fBkill\fP, \fBintr\fP, \fBquit\fP, \fBeof\fP, \fBeol\fP, \fBmin\fP, or \fBtime\fP (\fBmin\fP and \fBtime\fP are used with \fB\-icanon\fP; see \fItty\fP(4)). If \fIc\fP is preceded by an (escaped from the shell) caret (\fB^\fP), then the value used is the corresponding \*[doc-Tn-font-size]CTRL\s0 character (e.g., "\fB^d\fP" is a \fB\*[doc-Tn-font-size]CTRL\s0-d\fP); "\fB^?\fP" is interpreted as \*[doc-Tn-font-size]DEL\s0 and "\fB^\-\fP" is unterpreted as undefined. .Ed and for "\fBline\fP \fIi\fP" \(em "set line discipline to \fIi\fP (0 < \fIi\fP < 127 ).". The argument is a decimal integer, and the range enforced by the kernel. .Pp It's interesting to note here that .Qq Li ^- \(em .Sy 0377 (\c .%B UNIX System III Source Code , .Pa src/cmd/stty.c ) \(em is explicitly described as "undefined", rather than just "unlikely". No special provisions are made for .Sy 0xFF in the kernel, it .Em is just very unlikely \(em enough to be used as an undefined value. The gain of .Qq Li ^?\& matches that of .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 . It's unclear what "escaped from the shell" means \(em .Sy ^ doesn't appear to be special to to .Xr sh 1 (\c .%B Release 3.0 , pp. 237-333). .Pp The .Fl g format is the same as this implementation's .Pq Sx Saved Attributes , and read back the same way. .Pp The first line of the no-argument format starts with .Bd -literal -compact -offset 4n speed 300 baud; evenp .Ed .Pq or Sy oddp No as the case may be , or .Bd -literal -compact -offset 4n speed 300 baud; \-parity .Ed if .Sy \-parenb . This continues with the character size if .Sy parenb Em !\& Ns Sy cs7 or .Sy \-parenb Em !\& Ns Sy cs8 , and as usual with defaults of .Sy \-cstopb \-hupcl cread \- clocal (though, if .Sy \-cread , "cread" is written; this can only be a bug). .Pp The second line starts with .Qq Li line = Fa c_line Ns Li ;\& .Pq if not Sy 0 and continues with all .Sx Special Control-Characters separated with semicolons, as, given .Sy intr Li ^- .Sy quit Li ^?\& .Sy erase ^ Ns Ar E .Sy kill Ar K .Sy eof ^ Ns Ar @ .Sy eol Ar 0xD8 (which is uninputtable, but): .Bd -literal -compact -offset 4n intr ; quit = DEL; erase = ^e; kill = K; eof = ^`; eol = -X; .Ed .Pp The third line is the .Sx Input Modes , with defaults of .Sy \-ignbrk \-brkint inpck \-ignpar \-parmrk istrip \-inlcr \-igncr \-icrnl \-iuclc ixon ixany \-ixoff .Sy ( ignbrk hides the value of .Oo Sy \- Oc Ns Sy brkint ; .Sy \-inpck \(en of .Oo Sy \- Oc Ns Sy ignpar ; .Sy \-xon \(en of .Oo Sy \- Oc Ns Sy ixany ) . .Pp The fourth line is the .Sx Output Modes : either .Sy \-opost , or flags in manual order, default off (except for .Sy ofill ofdel rendered as "del-fill" and .Sy ofill \-ofdel rendered as "nul-fill") and .Sy 0 delays hidden. These (and two others, all listed below) are the only modes accepted as input but not noted in the manual. .Pp The fifth line is the .Sx Local Modes , with defaults of .Sy isig icanon \-xcase , .Oo Sy \- Oc Ns Sy echo .Oo Sy \- Oc Ns Sy echoe .Oo Sy \- Oc Ns Sy echok always written, then of .Sy \-echonl \-noflsh , .Pp The .Fl a format is similar, but arranged differently: the first line lists the speed, line discipline, and .Sx Special Control Characters ; the second the .Sx Control Modes , third \(en .Sx Input Modes (broken into fourth before .Oo Sy \- Oc Ns Sy ixon ) , fifth \(en .Sx Local Modes , sixth \(en .Sx Output Modes , all in manual order with no aggregation. .Pp .TS lb lb rb lb . Secret mode Is _ fill \h'\w'\-'u'ofill \-ofdel \-fill \-ofill \-ofdel nul-fill \h'\w'\-'u'ofill \-ofdel del-fill \h'\w'\-'u'ofill \h'\w'\-'u'ofdel .TE . .Ss UNIX User's Manual, Release 3.0, add'l bibliog.\& \(dg: .br .Rs .%C Maynard, Massachusetts .%D August 1976 .%N 4th Printing .%O General Description, 1.6 Specifications, \fBPerformance\fP, \fBReceivers\fP and \fBTransmitters\fP, \fIData Rate\fP .%P p. 1-5 .%Q Digital Equipment Corporation .%R EK-DJ11-MM-003 .%T DJ11 asynchronous 16-line multiplexer maintenance manual .\" http://bitsavers.org/pdf/dec/unibus/EK-DJ11-MM-003_DJ11_Maint_Man_Aug76.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:EK-DJ11-MM-003_DJ11_Maint_Man_Aug76.pdf .Re .Pp \(dd: .br This configuration is called out explicitly in the manual: .Bd -filled -compact -offset 4n A typical application of the KMC11 is the control of several peripheral devices attached to the UNIBUS. These devices, for example the DZ11 8-line asynchronous multiplexer, typically operate by programmed I/O, interrupting the PDP-11 processor for each character input or putput. However, with the addition of a KMC11, this processor overhead can be substantially reduced and I/O throughput increased. .Ed .Sy ofill Ns ing delays doesn't appear to be a fundamental side-effect of this. .Rs .%C Maynard, Massachusetts 01754 .%D December 1977 .%N Second Printing .%O Introduction, 1.2 KMC11 General Description, 1.2.1 Controlling Peripherals over the UNIBUS .%P p. 1-2 .%Q Digital Equipment Corporation .%R AA-5244B-TC .%T KMC11 Programmer's Manual .\" http://bitsavers.org/pdf/dec/unibus/KMC11_ProgMan.pdf .%U http://bitsavers.org/\:pdf/\:dec/\:unibus/\:KMC11_ProgMan.pdf .Re . .Ss UNIX System User's Manual, System V; UNIX Administrator's Manual, Release 5.0 Yes, there's two of them, and yes, they're branded differently; this coincides with the Bell System break-up, and the User's Manual title page has a beautifully-crafted "we're kinda mad about this but don't wanna be openly super mad about it" blurb \(em .Rs .%B UNIX System User's Manual, System V .%D January 1983 .%I Western Electric Company, Incorporated. .%N 301-905 Issue 1 .%P p. 1 .\" http://bitsavers.org/pdf/att/unix/System_V_Release_1/301-905_UNIX_System_V_Release_1_Users_Manual_Jan83.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_1/\:301-905_UNIX_System_V_Release_1_Users_Manual_Jan83.pdf .Re .Pp The manual sections are helpfully rearranged: i.a., devices ("Special Files") now live in section 7 \(em .Rs .%B UNIX System Administrator's Manual, Release 5.0 .%D June 1982 .%I Bell Laboratories, Inc. .%N 301-926 ISS. 1 .%O Introduction .%P p. 3 .\" http://bitsavers.org/pdf/att/unix/System_V_Release_1/301-926_UNIX_System_V_Release_1_Administators_Manual_Jun82.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_1/\:301-926_\:UNIX_\:System_V_\:Release_1_\:Administators_Manual_\:Jun82.pdf .Re .Pp The haphazard assembly of random uploadable code is productised as .Xr stermio 7 (ibid., p. 234) \(em "general synchronous terminal interface" \(em which roughly simulates the normal teletype interface, alongside .Xr stgetty 1M (ibid., p. 160) and .Xr stlogin 1 (\c .%B UNIX System User's Manual, System V , p. 351). We are, thankfully, saved from a hypothetical .Xr ststty 1 , but not .Xr scat 1 (ibid., p. 305). .Pp .de strikethrough .ie t \\$1\\$2\l'-\w'\\$2'u\(en'\\$3 .el \\$1\\$3 .. .Xr login 1 (ibid., pp. 231-232)'s "\(Fcexternal\(Fo password" reverts to its .Tn CB-UNIX spelling (or, more likely, the .strikethrough \& in-breeding cross-pollination goes the other way, or, likelier still, since .Tn CB-UNIX is noted as a source system for .%B Release 3.0 .Em and post-dates it, both). .Pp The same holds for .Xr getty 1M (\c .%B UNIX System Administrator's Manual, Release 5.0 , pp. 116-117), they're both dated March 13, 1981 (with header for "CB\-UNIX 2.3") in the .%B CB-UNIX Programmer's Manual , so it's best-described in terms of the differences from .Em there . "[ \fB\-t\fP timeout ]" "specifies that \fIgetty\fP shold exit if the ope non the line succeeds and no one types anything in the specified number of seconds." \(em this is essentially a port of .%B Release 3.0 .Ar delay . The .Ar type list is (unexpectedly?) .Em shorter : .TS l4zw0 lb l . none default vt61 \*[doc-Tn-font-size]DEC\s0 vt61 vt100 \*[doc-Tn-font-size]DEC\s0 vt100 hp45 Hewlett-Packard \*[doc-Tn-font-size]HP\s045 c100 Concept 100 .TE And caveatted: .Bd -filled -compact -offset 4n Also, for terminal type to have any meaning, the virtual terminal handlers must be compiled into the operating systems. They are available, but not compiled int he default condition. .Ed The more robust line discipline zero is infinitely better than the gang of .Tn CB-UNIX ones, so so is .Ar linedisc : .Bd -filled -compact -offset 4n Again the hooks for line disciplines are available in the operating system but there is only one presently available, the default line discipline, \*[doc-Tn-font-size]\fBLDISC0\fP\s0. .Ed .Pp .Sy ^ Ns Ar U is also understood when reading the username, and .Sy kill adjusted. If the "\(Fcstandard\(Fo \*[doc-Tn-font-size]ESS\s02" (note the odd updated branding) line editing characters are seen, "it arranges for this set of characters to be used for these functions.", rather than setting an exotic mode, since they all do map here, as .Sy intr Ar & .Sy erase Ar _ .Sy kill Ar $ .Sy eol Ar / .Sy eol2 Ar !\& \(em this checks out in the source, likewise provided to me by my good friend Juliano: .Rs .%O \*[doc-Pa-font]sysv-pdp11_usr-src/cmd/getty.c\fP .%R UNIX SYSVr1 Source Code .\" https://vetusware.com/download/UNIX%20SYSVr1%20Source%20Code%20r1/?id=11570 .%U https://vetusware.com/\:download/\:UNIX%20SYSVr1%20Source%20Code%20r1/\:?id=11570 .Re .Pp .Xr dz 7 (\c .%B UNIX System Administrator's Manual, Release 5.0 , p. 199) is marked "(DEC only)"; the "(3B20S only)" .Xr tn4 7 (ibid., p. 246) and .Xr tn74 7 (ibid., p. 257) appear, identical except the former is eight-line and the latter \(en two-line: "The \fIc_cflag\fP items of \fBB200\fP, \*[doc-Tn-font-size]\fBEXTA\fP\s0, and \*[doc-Tn-font-size]\fBEXTB\fP\s0 are not available.", which sounds an awful lot .Em just like the .Tn DZ11 . .Pp .Xr tty 4 is split into .Xr tty 7 (ibid., p. 252) \(em "controlling terminal interface" \(em with the .Pa /dev/tty description paragraph and .Xr termio 7 (ibid., pp. 238-244) contains the rest, unchanged. .Pp Of course, the header itself .Em does change, if only to accomodate the .Dv STDTTY replacement \(em now .In sys/termio.h , .Dv VEOL2 is allocated as .Fa c_cc Ns Bq Sy 6 (\c .%B UNIX SYSVr1 Source Code , .Pa sysv-pdp11_usr-src/uts/sys/termio.h ) . Video-terminal-specific flags also appear \(em the list of terminals is taken .Em verbatim , down to "Hewlitt", from .Tn CB-UNIX , as are the flags, and argument format (this is also copied verbatim, save for the new .Fn ioctl names): .Bd -literal -compact -offset 4n /* * structure of ioctl arg for LDGETT and LDSETT */ struct termcb { char st_flgs; /* term flags */ char st_termt; /* term type */ char st_crow; /* gtty only - current row */ char st_ccol; /* gtty only - current col */ char st_vrow; /* variable row */ char st_lrow; /* last row */ }; .Ed .Pp .Xr stty 1 (\c .%B UNIX System User's Manual, System V , pp. 355-357) is unchanged, save for the addition of some .Xr stermio 7 Ns -specific modes. These are outlined below, but they aren't "actually" local, since that interface is much simpler (if insane). .Pp .TS l2b lb lb l . Local Modes Description _ stwrap (\-stwrap) disable (enable) truncation of lines longer than 79 characters on a synchronous line. stflush (\-stflush) enable(disable) flush on a synchronous line after every \fIwrite\fP(2). stappl (\-stappl) use application mode (use line mode) on a synchronous line. .TE .Pp More importantly, a copy-paste error that meant .Sy \-lcase included .Sy \-xcase but .Sy \-LCASE didn't is fixed \(em (\c .%B UNIX SYSVr1 Source Code , .Pa sysv-pdp11_usr-src/cmd/stty.c ) . .Pp This does leave the system in an odd state where .Dv VEOL2 is supported .Pq ibid., Pa sysv-pdp11_usr-src/uts/pdp11/io/tt Ns Ar ?\& Ns Pa .c , but only settable by .Nm getty , and not even observable with .Nm stty . This must be a fun mode to try to get out of if you trigger it by accident. . .Ss UNIX System V Release 2.0 The only way you'd know that these are .At V.2 is by process of elimination, since that's the largest release number that appears on exactly one page out of the entire 530-page volume \(em .Rs .%A Steven V. Earhart .%B UNIX Programmer's manual .%D 1986 .%I AT&T .%J CBS College Publishing's UNIX System Library .%N Select Code 230-031 .%N ISBN 0-03-009317-1 .%O \*[doc-Xr-font]convert\fP(1) .%P pp. 77-78 .\" http://bitsavers.org/pdf/att/unix/System_V_Release_2/UNIX_Programmers_Manual_Vol_1_Commands_and_Utilities_1986.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_2/\:UNIX_\:Programmers_\:Manual_\:Vol_1_\:Commands_\:and_\:Utilities_\:1986.pdf .%V Volume 1: Commands and utilities .Re .Pp Rather than saying that .Sy @ "\(Fckills\(Fo" all prior characters on the line, it now "cancels" them (ibid., Introduction, How To Get Started, How to communicate through your terminal, para. 3, p. vii). .Pp .Xr stermio 7 and friends appear to be gone, and the individual driver pages are lost \(em .Rs .%A Steven V. Earhart .%B UNIX Programmer's manual .%D 1986 .%I AT&T .%J CBS College Publishing's UNIX System Library .%N Select Code 230-033 .%N ISBN 0-03-009313-9 .%O Table of Contents .%P pp. vii-viii .\" http://bitsavers.org/pdf/att/unix/System_V_Release_2/UNIX_Programmers_Manual_Vol_3_System_Administration_Facilities_1986.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_2/\:UNIX_\:Programmers_\:Manual_\:Vol_3_\:System_\:Administration_\:Facilities_\:1986.pdf .%V Volume 3: System administration facilities .Re .Pp .Xr termio 7 (ibid., pp. 119-129) now has "SWTCH" allocated as .Fa c_cc Ns Bq Sy 7 with no default listed, but the summary describes it as .Bd -filled -compact -offset 4n (Control-z or \*[doc-Tn-font-size]ASCII SUB\s0) is used by the job control facility, \fIshl\fP, to change the current layer to the control layer. .Ed Picking SUB(stitute) is probably the only sane part of this model of "job control". .Pp .Dv ISIG and .Dv NOFLSH also govern .Sy swtch p.a. to .Sy intr quit . .Pp A .Fa c_cflag .Dv LOBLK ("Block layer output.") is added, described as .Bd -filled -compact -offset 4n If .Tn LOBLK is set, the output of a job control layer will be blocked when it is not the current layer. Otherwise the output generated by that layer will be multiplexed onto the current layer. .Ed Which is kinda like .Sy tostop if .Sy tostop just blocked instead of .Dv SIGTTOU Ns ing . .Pp The .Sx SEE ALSO defers to .Xr shl 1 (\c .%B UNIX Programmer's manual, Volume 1, 1986 , pp. 397-398) \(em "shell layer manager", no-argument .Sx SYNOPSIS , .Bd -filled -compact -offset 4n \fIShl\fP allows a user to interact with more than one shell from a single terminal. The user controls these shells, known as \fIlayers\fP, using the commands described below. .Ed The I/O is as-expected \(em reading from a background "layer" blocks, setting .Qq Oo Sy \- Oc Ns Sy loblk "within the layer" (since all of these sessions are just on different teletypes) is as-described. .Bd -filled -compact -offset 4n The \fIstty\fP character \fBswtch\fP (set to ^Z if \*[doc-Tn-font-size]NUL\s0) is used to switch control to \fIshl\fP from a layer. \fIShl\fP has its own prompt, \fB>>>\fP, to help distinguish it from a layer. .Ed Notably, this is the .Em only instance of special treatment of a character, and there .Em is an established .Dv C Ns -prefix convention which is used for everything else .Em and this \(em .Dv CSWTCH is defined correctly \(em but the kernel doesn't use it, and initialises it to .Sy 0 . At least the special treatment is only in the userspace, and .Nm shl sets .Sy swtch to .Dv CSWTCH if it's…\& .Dv CNSWTCH , which is defined to .Sy 0 just below its non-no variant. Note also that this .Em overlaps with the default settings for .Sy eol eol2 \(em and takes precedent over them, so .Qq Tn EOL , whose description starts with .Qq Pq Tn ASCII NUL is invalidated by default if .Sy isig . .Bd -filled -compact -offset 4n A \fIlayer\fP is a shell which has been bound to a virtual tty device (\fB/dev/sxt???\fP). The virtual device can be manipulated like a real tty device using \fIstty\fP (1) and \fIioctl\fP (2). Each layer has its own process group id. .Ed .Pp There's a prompt, so this is naturally conversational. A .Em summary of meaningful commands (for the full inglory, see the original) is included below, with their job control equivalents. For the purposes of this analysis, one could consider a .Sy ^ Ns Ar Z here and .Sy ^ Ns Ar Z Ns \&, Ic bg on a modern .Pq Qq Bx Ns -style system the same fundamental operaition; things diverge from there. .Pp .TS l2b l2b lb lb l lx . Command Equivalent Add'l summary _ create \fR[\fP \fIname\fP \fR]\fP \*[doc-Ev-font]PS1\fP="\fIname \fP" \*[doc-Nm-font]sh\fP T{ The default \fIname\fP is a digit \(em the last character of the layer's \*[doc-Xr-font]sxt\fP(7) device \(em in parentheses. Explicit "\*[doc-Sy-font](\fP\*[doc-Ar-font]digit\fP\*[doc-Sy-font])\fP" \fIname\fPs are therefore illegal. T} delete \fIname\fP \fR[\fP \fIname\fP \fR... ]\fP \*[doc-Nm-font]kill\fP \*[doc-Cm-font]-\fP\*[doc-Ar-font]HUP\fP \*[doc-Sy-font]%\fP\fIname\fP… T{ Deletes the specified layers; the \*[doc-Dv-font]SIGHUP\fPping is a result of that. T} layers \fR[\fP \-l \fR] [\fP \fIname\fP \fR... ]\fP \*[doc-Nm-font]jobs\fP [\*[doc-Sy-font]%\fP\fIname\fP…] T{ Roughly. No-\fB\-l\fP lists just the names and "process group" (which is more akin to \*[doc-Nm-font]jobs\fP \*[doc-Cm-font]-p\fP). "The \fB\-l\fP option produces a \fIps\fP(1)-like listing.", which is closer to present-day no-flag \*[doc-Nm-font]jobs\fP. T} resume \fR[\fP \fIname\fP \fR]\fP \*[doc-Nm-font]fg\fP or \*[doc-Nm-font]fg\fP \*[doc-Sy-font]%\fP\fIname\fP toggle \*[doc-Nm-font]fg\fP \*[doc-Sy-font]\-\fP "the layer that was current before the last current layer" quit \*[doc-Sy-font]^\fP\*[doc-Ar-font]D\fP All layers get \*[doc-Dv-font]SIGHUP\fPped. \fIname\fP \*[doc-Nm-font]fg\fP \*[doc-Sy-font]%\fP\fIname\fP .TE Of course, modern shells will decidedly object to being job-controlled, but in the context of .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 under .Nm csh .Pq with a job-control-agnostic Nm sh , this does hold .Pq as verified on a Bx 4.2 No system . Not that in general you'd actually want to job-control entire shell sessions, but. .Pp Hidden in the \fBcreate\fP description is the blurb that "A maximum of seven layers can be created.". This is by far the worst "job control" scheme ever devised; its only "redeeming" quality is that .Xr sxt 7 (\c .%B UNIX Programmer's manual, Volume 3, 1986 , pp. 116-118) provides almost-general virtual teletypes. .Pp .Xr getty 1M (ibid., pp. 64-66) appears to lose both the .Tn ESS and .So Sy \eb Sc Ns / Ns Sq Sy ^U processing, but doesn't, it just stops being documented. Also undocumented is that it starts setting .Sy xcase for lines it deems upper-case-only \(em this is apparent in the source, similarly provided to me by my good friend Juliano: .Rs .%O \*[doc-Pa-font]src/cmd/getty.c\fP .%R UNIX SYSVr2 Source Code .\" https://vetusware.com/download/UNIX%20SYSVr2%20Source%20Code%20r2/?id=11571 .%U https://vetusware.com/\:download/\:UNIX%20SYSVr2%20Source%20Code%20r2/\:?id=11571 .Re .Pp It's important to note that the manuals post-date the system by approximately two years \(em the kernel branding is for 1984 .Pq ibid., Pa src/uts/vax/os/main.c and other, themselves unsourced, secondary sources agree. .Pp .Xr login 1 (\c .%B UNIX Programmer's manual, Volume 1, 1986 , pp. 232-234) gains a fun facility where if the shell .Xr passwd 5 field is .Li * , it chroots to the home directory and reexecs .Pa /etc/login , .Pp The aforementioned .Sy swtch Ns / Ns Sy eol Ns Op Sy 2 precedence is .%B UNIX SYSVr2 Source Code , .Pa src/uts/vax/io/tt0.c , .Fn ttin , .Li "if (flg) while (nchar--)" . .Pp .Xr termio 7 Extends "or the timeout value \*[doc-Tn-font-size]TIME\s0 has expired" to "has expired between characters"; ibid. and .Pa tt Ns Bo Pa y1 Bc Ns Pa .c corroborate that this just a wording change. .Pp Ibid., .Pa src/uts/sys/termio.h concretifies speeds: .\" My only grave sin: i reflew cleaned onto the next line to fit the page .Bd -literal -compact -offset 4n #define B19200 0000016 #define B38400 0000017 /* EXTA and EXTB should be deleted when */ /* cleaned out of the source */ #define EXTA 0000016 #define EXTB 0000017 /* they are aliases for b19200 and B38400 */ .Ed This clean-out doesn't appear to have been done, and there are zero users, but. .Pp .Xr stty 1 (\c .%B UNIX Programmer's manual, Volume 1, 1986 , pp. 420-423) loses the .Xr stermio 7 references (but .Em not the "\fBst\fP*" modes), gains the .Dv LOBLK proxy, below, adds .Tn SWTCH notes to "\fBisig (\-isig)\fP", "\fBnoflsh (\-noflsh)\fP", and "\fBraw (\-raw\fP or \fBcooked)\fP" and a .Sy swtch one to .Sx Control Assignments . .Pp In "\fBhupcl (\-hupcl)\fP" .Qq a Tn DATA-PHONE\(rg No data set connection is reduced to .Qq Tn DATA-PHONE\(rg No connection . .Pp The description for "\fBclocal (\-clocal)\fP" starts with an 'n', for "n assume…". Unclear why. .Pp .TS lb lb lb l . Control Modes Description _ loblk (\-loblk) block (do not block) output from a non-current layer. .TE .Pp .%B UNIX SYSVr2 Source Code , .Pa src/cmd/stty.c lines up with this, except all mentions of .Dv LOBLK and .Dv VSWTCH are predicated on not being built for the .Tn PDP-11 . Presumably due to memory constraints? But enforcing this .Em here is odd. .Pp The default for no-argument output is .Qq Sy \-loblk . . .Ss UNIX\(rg System V User's Reference Manual; AT&T System V.3 Administrator's Reference Manual In this case the only way to figure out that this 350-page volume is for .At V.3 is in the .Sx SEE ALSO section in .Rs .%B UNIX\(rg User's Reference manual .%D 1987, 1986 .%J Prentice-Hall C and UNIX\(rg Systems Library .%N ISBN 0-13-940487-2 025 .%O \*[doc-Xr-font]getopts\fP(1) .%P pp. 116-117 .%Q AT&T .\" http://bitsavers.org/pdf/att/unix/System_V_Release_3/UNIX_System_V_Users_Reference_Manual_1987.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_3/\:UNIX_System_V_Users_Reference_Manual_1987.pdf .Re .Pp The "valid user name" requirement is changed to "valid login id" \(em the purpose of this is unclear, unless the editor was smoking on that psychoanalysis mid \(em and the "common"/"occasionally available" dichotomy is hegelised by commonalising all of them and removing .Sy 110 , 150 , No and Sy 300 baud, all of which between ten- and four-fold slower than the slowest listed, now .Sy 1200 , 2400 , 4800 , No and Sy 9600 baud (ibid., Introduction, How To Get Started, Logging In, paras. 1-2, p. 4). .Pp "you can simply hang up the phone" is for the first time predicated \(em "If you've dialed in," (ibid., Logging Out, p. 5). .Pp The gnome is fired, replaced by impersonal language; automation gets to us all in the end (ibid., How to Communicate Through Your Terminal, para. 1, p. 5). .Pp "(\fB@\fP is called the line kill character.)" \(em which wasn't actually clear before (ibid., para. 3). One wonders what the purpose of changing the description in the forst place was. .Pp The first occurrence of the "\*[doc-Tn-font-size]\fBCONTROL-\fP\s0" notation explains how to type the characters described ("pressing the control key and aplhabetic \fBs\fP simultaneously"). The rest of the .Sy stop Ns / Ns Sy start paragraph is rewritten to be almost cute .Pq if you forget that this is Tn AT&T No product : .Bd -filled -compact -offset 4n Thus, if you had typed \fBcat yourfile\fP and the contents of \fByourfile\fP were bassing by on the screen more rapidly than you could read it, you would type \*[doc-Tn-font-size]\fBCONTROL-S\fP\s0 to freeze the output for a moment. Typing \*[doc-Tn-font-size]\fBCONTROL-Q\fP\s0 would allow the output to resume its rapid pace. .Ed The "(or any other character, for that matter)" is removed, even though .Sy ixany is still the default (ibid. para. 4, pp. 5-6). .Pp And the only extant archived document that should have .Xr getty 1M instead defers to .Tn D-NIX Ns -specific documentation \(em .Rs .%B AT&T System V.3 Administrator's Reference Manual .%C S-183 02, Täby, Sweden .%D 89-11-01 .%N Version A .%O Manual references, G .%P p. 264 .%Q Diab Data AB .%R 089-9717-00 .\" http://bitsavers.org/pdf/diab/DS90/AT_T-System-V.3-administrators-reference-manual.pdf .%U http://bitsavers.org/\:pdf/\:diab/\:DS90/\:AT_T-System-V.3-administrators-reference-manual.pdf .Re .Pp .Xr termio 7 (ibid., pp. 229-236) finally describes what it means by "flushing" a buffer by expounding .Bd -filled -compact -offset 4n When the input limit is reached, the buffer is flushed and all the saved characters are thrown away without notice. .Ed and notes .Tn EOL2 in the summary as "is another additional line delimiter."; the allocation table remains unchanged. New .Fa c_cflag Ns s are listed below. .Pp .TS lfCI lb lb lfCR lfCR l . c_cflag Pos'd before Description _ B19200 EXTA 19200 baud B38400 EXTB 38400 baud .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& RCV1EN LOBLK XMT1EN \^ .TE The .Pf pre- Dv LOBLK insertions also move the values: .Dv LOBLK was .Sy 0010000 , now that's .Dv RCV1EN , and they continue to be shifted left by one as-if normal. .Pp These new flags are not described (in the manual or the comment) or indeed used anywhere on the system, so the only side-effect of this is that .Nm stty , the only user-space .Dv LOBLK user, needs to be rebuilt \(em thanks as ever to my good friend Juliano for lending me the dumps: .Rs .%O \*[doc-Pa-font]32/\:usr/\:src/\:uts/\:3b2/\:sys/\:termio.h\fP .%R UNIX SYSVr3 Source Code .\" https://vetusware.com/download/UNIX%20SYSVr3%20Source%20Code%20r3/?id=11572 .%U https://vetusware.com/\:download/\:UNIX%20SYSVr3%20Source%20Code%20r3/\:?id=11572 .Re .Pp The system-default speed is set to .Sy 1200 baud on the .Tn U3B16 (ibid.). .Pp In .\" .At V.3.2 \*[doc-Tn-font-size]AT&T\s0 System\~V Release\~3.2 \*[doc-Tn-font-size]UNIX\s0 specifically .Pq cf. Pa 31/usr/src/uts/3b2/sys/termio.h , .Dv TIOC Ns Oo Dv GS Oc Ns Dv WINSZ (ibid.) and the corresponding .Vt "struct winsize" appear, all as present-day .Pq ibid., Pa 32/usr/src/uts/3b2/sys/ptem.h Ns ;\& dated 1984 , nominally predating Sx 4.3 Berkeley Software Distribution No by two years . .Pp .Xr stty 1 (\c .%B UNIX\(rg User's Reference manual, 1987, 1986 , pp. 257-259) starts with explaining the character format in the output (and failing to escape the accents into proper carets and backticks, so, especially in double quotes, they're absolute hash; this is fixed below), most notably: .Bd -filled -compact -offset 4n For example, normally \fBstty \-a\fP will report that the value of \fBswtch\fP is "\fB^`\fP"; however, if \fBshl (1)\fP or \fBlayers (1)\fP has been invoked, \fBstty \-a\fP will have the value "\fB^z\fP". .Ed (Where .Xr layers 1 (ibid., pp. 148-149) is "layer multiplexor for windowing terminals", out of scope, impossible to characterise without the .Xr xt 7 (which may have "channel groups", likely some sort of generalisation of .Xr sxt 7 , backing .Xr shl 1 ) manual; layers are "manipulated in a terminal-dependent manner" and "Each layer is in most ways functionally identical to a separate terminal.", so you could think of it like the back of an .Xr xterm 1 , whose front (render, display, windowing, &c.) is provided by the terminal hardware.) .Pp .Sx Control Modes .Sy exta extb are replaced with .Sy 19200 38400 . .br .Qq Tn DATA-PHONE\(rg in "\fBhupcl (\-hupcl)\fP" description is replaced with .Qq Tn Dataphone . .br The descriptions for the three "\fBst\fP*" .Sx Local Modes all gain "(Does not apply to the 3B2.)". .Pp Indeed, not even compatibility aliases remain, but secret .Qq Sy 19.2 and .Qq Sy 38.4 aliases appear (\c .%B UNIX SYSVr3 Source Code , .Pa 301/usr/src/cmd/stty/stty.c ) . The output speed table is updated appropriately to not show the newly-numeric speeds as .Sy 0 . .Pp Additionally, .Sy sane doesn't reset .Sy swtch anymore, accompanied by a .Qq Li "/* SWTCH purposely not set */" comment. Maybe it would've been a better idea to just make the default… sane? And not have .Qq Nm Sy sane effectively turn off job control? We may never know. . .Ss X/OPEN Portability Guide (July 1985) .Xr termio 7 , as found in the .%B System V Interface Definition, Issue 1 (Spring 1985) .\" the specific ref here for the ref is 1.2.3 Relationship to SVID is optional, .Rs .%B X/OPEN Portability Guide .%C The Netherlands .%D July 1985 .%I The X/OPEN Group Members .\".%N Issue 1 .%N ISBN: 0 444 87839 4 .%O \*[doc-Pa-font]xpg_2_xopen_system_v_specification_1.pdf\fP .%P Chapter 1 Interface Definition, 1.2 Status of Interfaces, 1.2.2 Optional .\" http://bitsavers.org/pdf/xOpen/X_Open_Portability_Guide_1985 .%U http://bitsavers.org/\:pdf/\:xOpen/\:X_Open_Portability_Guide_1985 .%V Part II The X/OPEN System V Specification .Re .br Because "Some X/OPEN systems may not support any asynchronous lines, or may only support them over networks."\& (ibid., 1.10 Caveats, 1.10.2 Termio(7)). Provisions are made for awful V.24/RS232C implementations with no modem control \(em the carrier is to be assumed always-present. .Pp Ibid., .Pa xpg_2_xopen_system_v_specification_3.pdf , Chapter 7 Special Files, \fIconsole\fP(7) (p. CONSOLE(7).1) \(em "System console interface" \(em and \fItty\fP(7) (p. TTY(7)) are included verbatim, "except that the SVID states that the system console works through the \fItermio\fP interface. This is not necessarily true of X/OPEN systems.". .Pp .\" Per the scan above .defcolor xopencolour rgb #7ac675 .Xr termio 7 (ibid., pp.\& TERMIO(7).1-TERMIO(7).11) \(em "general terminal interface \m[xopencolour](OPTIONAL)\m[]" \(em is "Identical to the SVID entry" "except for minoar changes to the first paragraph", but since that's lost to time, the delta below is presented from just .At V.2 , and likely applies to both documents. Expectedly, the specific process names (like being "opened by \fIgetty\fP") are generalised to "the system". .Pp Rather than a hard .Sy 256 bytes, the current limit becomes "{MAX_CHAR} characters", defined in .Xr limits 5 (ibid., Chapter 5 Header Files, pp.\& LIMITS(5).1-LIMITS(5).2) \(em "Implementation Specific Constants" \(em in .In limits.h as "max size of character input buffer" with no minimum value. .Pp If the process being STOPped hasn't "made other arrangements", additionally "the abnormal termination routines will be executed", rather than explicitly a .Pa core core dump. .Pp SWTCH is missing from the summary (presumably because it just defers to a specific program?) and the subsequent list of .Sx Special Control Characters changeable by the user, but the .Fa c_cc allocation table is unchanged. This has the side-effect of continuing to omit .Dv VEOL2 and the out-of-order allocation and lack of .Dv VSWTCH default being unexplained in (now) a standards document. .Pp .Dv NCC is generalised to .Bd -literal -compact -offset 4n .ft R /* size of the array * c_cc for special control characters */ .ft P .Ed And the unlabelled delay macros gain descriptions in the form of .Pq Carriage-return delay type Ar N (except it's "Backspace-delay" for some reason); .Dv NL Ns Bq Dv 01 are instead described as .Qq New-Line character type Ar N with no corresponding description change \(en the meaning of this is unclear. .Pp .Dv EXT Ns Bq Dv AB are removed entirely and replaced with .Dv B19200 , .Dv B38400 (notably more extreme than .At V.3 , but at that point no device in common use has supported the "external" speeds for years). .Pp .Dv TC Ns Bo Dv GS Bc Ns Dv ETA spellings are replaced with .Dv TC Ns Bo Dv GS Bc Ns Dv ETS , with links to .Sx APPLICATION USAGE , noting: .Bd -filled -compact -offset 4n TCGETA and are \fIioctl\fP(2) commands that are reserved to maintain source code compatibility. Their use is even more system dependent than the \fItermio\fP interface and source code that uses these commands may not work correctly on all systems. .Ed This may ring roughly true on some weird derivatives, but doesn't appear close to reasonable for the range of systems described herein so far. Of course, .Dv TCSETA Ns Bq Dv WF remain unchanged. .Pp A .Sx MIN/TIME Interaction section is added, expounding the minutiae of how .Sy min time govern .Sy \-icanon input buffering. It's all as-described and the wording largely survives with editorial changes to .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1 \(em the prose re-states the in-line "This allows fast bursts of input to be read efficiently while still allowing single character input."\& "The time value represents tenths of seconds."\& prescription of purpose as "TIME is a timer of 0.1 second granularity that is used to timeout bursty and short term data transmissions.". .Pp A notable mention is also found in ibid., Part VI Source Code Transfer, Chapter 5 Other Techniques .Pq Pa xpg_6_source_code_transfer.pdf Ns \&, p. 5.1 with the following requirement from the "far from easy to use" .Nm uucp : .Bd -filled -compact -offset 4n The TTY drivers should support XON/XOFF (ASCII DC1/DC3) handshaking and an 8-bit transparent mode. .Ed . .Ss X/Open Portability Guide (December 1988) .Tn X/Open No Portability Guide Issue\~2 Pq Dq Tn XPG Ns \^2 \" .St -xpg2 doesn't appear to have been archived at all, and of .%B Issue 3 only .%B Volume 1 seems to've been, so tracking changes to the teletype interface is, unfortunately, impossible. .%B Issue 2 is the first one to include utilities, and "Little material in this volume has been updated since Issue 2." \(em .Rs .%B X/Open Portability Guide, XSI Commands and Utilities .%C Abbots House, Abbey Street, Reading, Berkshire, \\*[doc-Tn-font-size]RG1 3BD\s0, United Kingdom .%D December 1988 .%I X/Open Company, Ltd. .%N Issue 3 .%N ISBN 0-13-685835-X .%O Chapter 1 Introduction, 1.1 OVERVIEW, 1.1.2 Important Note .%P p. 1 .\" https://archive.org/details/xopen-portability-xsi-commands-utilities/page/n5/mode/2up .%U https://archive.org/\:details/\:xopen-portability-xsi-commands-utilities/\:page/n5/\:mode/2up .%V Volume 1 .Re .Pp Notably, however, i.a., "the current descriptions of the utilities are incomplete and lack precision" and "There are many inconsistencies in the use of terminology in this volume", so .Bd -filled -compact -offset 4n The \fBIEEE P1003.2 Shell and Application Utilities Interface for Computer Operating System Environments\fP Working Group is currently redefining most of the utilities in this volume. This volume will be aligned with \fB\*[doc-Tn-font-size]IEEE\s0 Std. 1003.2-19xx\fP after \fB\*[doc-Tn-font-size]IEEE\s0 Std. 1003.2-19xx\fP attains full use status. During this alignment process the problems noted above will be addressed. .Ed Which is a bit of a cop-out from the back-cover "X/Open is not a standards-setting body.". .Pp .defcolor xpg3colour rgb #2d5a91 Ibid., \fI\m[xpg3colour]Utilities\m[]\fP, \fBstty\fP (pp. 252-256) is largely just the .At V.2 one \(em with the first .Xr termios 7 reference appropriately updated to .%B Volume 2 and the rest removed \(em and shaded UN ("Possibly unsupportable feature."). No changes from .%B Issue 2 are noted. .Pp .Qq Sy 0 is generalised to .Bd -filled -compact -offset 4n hang up line immediately. This applies to all terminal lines, not just modem lines. A \*[doc-Tn-font-size]SIGHUP\s0 signal is sent to all processes attached to the line. .Ed .Pp The list of speeds becomes a "\fInumber\fP" mode, described as .Bd -filled -compact -offset 4n set terminal baud rate to the \fInumber\fP given, if possible. (Not all speeds are supported by all hardware interfaces.) .Ed .Pp The "\fBhupcl (\-hupcl)\fP" "\*[doc-Tn-font-size]DATA-PHONE\(rg\s0" is debranded to "modem". .br The stray "n" in "\fBclocal (\-clocal)\fP" is pruned. .Pp "\fBloblk (\-loblk)\fP" is caveatted on .Bd -filled -compact -offset 4n The \fIloblk\fP option is supported on systems that support \fIshl\fP. This option may not be supported by all hardware interfaces. .Ed .Pp The odd "\fBbrkint (\-brkint)\fP" "\*[doc-Tn-font-size]INTR\s0" sugnalling subject becomes a reasonabler "\*[doc-Tn-font-size]SIGINT\s0". .br "\fBixon (\-ixon)\fP" loses the description of how its "\*[doc-Tn-font-size]START/STOP\s0 output control" actually happens, and "\fBixany (\-ixany)\fP" loses the definition for the counterfactual. .br All "\*[doc-Tn-font-size]NL\s0"s and "\*[doc-Tn-font-size]CR\s0"s are expanded to "newline"s and "carriage-return"s; for "\fBonlret (\-onlret)\fP" "on the terminal \*[doc-Tn-font-size]NL\s0 performs" becomes "the terminal newline key performs"; "carriage returns" in "\fBcr0 cr1 cr2 cr3\fP" are matched to this new punctuation. .br The .Dv VSWTCH erasure continues in its elision from "\fBisig (\-isig)\fP", "\fBnoflsh (\-noflsh)\fP", and "\fBraw (\-raw\fP or \fBcooked)\fP". .br The "obsolete" "\fBlfkc (\-lfkc)\fP" is removed and the "\fBst\fP*" modes naturally do not fit into the standard. .br "\fIswtch\fP" in the .Sx \m[xpg3colour]Control Assignments\m[]\& is shaded OP ("Dependent on optional service in XSI."), and the line discipline range is rephrased as "[0, 127]". .br "\fBraw (\-raw\fP or \fBcooked)\fP" additionally says it means "and no parity". It's unclear what this could mean. .br The "\fBtabs (\-tabs\fP or \fBtab3)\fP" becomes "\fBtabs (\-tabs\fP \fIor\fP \fBtab8)\fP" it's wildly unclear what that could .Em possibly mean, except maybe that the editor needs new glasses? .br "\fBek\fP" resets "back to the system defaults" rather than any explicit values. .br The "\fBterm\fP" combo group is gone. .Pp The .Sx \m[xpg3colour]APPLICATION USAGE\m[]\& section notes that "Typical implementations of this utility require a communications line configured to use the \fItermios\fP interface" (and, if none exist, you may not ship .Nm ) \(em this (or .%B Issue 2 , naturally) is the first occurrence of "termios", at least nominally distinct from any existing interface. . .Ss IEEE Standard Portable Operating System Interface for Computer Environments, Approved August 22, 1988 This isn't strictly spelled out in .%B Volume 1 , but "XSI Issue 3 is fully compliant with IEEE Std 1003.1-1988 (POSIX.1)." \(em .Rs .%B XPG3-XPG4 Base Migration Guide, Version 2 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D December 1995 .%I X/Open Company Limited .%N ISBN: 1-85912-156-X .%N X/Open Document Number: G501 .%O Part 1: General Information, Chapter 1 Introduction, 1.3 Conformance to Standards .%P p. 6 .\" https://pubs.opengroup.org/onlinepubs/9294999899/toc.pdf .%U https://pubs.opengroup.org/\:onlinepubs/\:9294999899/\:toc.pdf .Re .Pp The deltas listed for the interfaces agree (ibid., Part 3: System Interfaces and Headers Migration, Chapter 7 System Interfaces, all functions \fBcf\fP*( ) and \fBtc\fP*( ), pp. 127-128, 204-207) (ibid., Chapter 8 Headers, 8.3 Header Migration Information, \fB\fP, p. 235), so this is a reasonable proxy .Pq \(+- Tn X/OPEN No bugs to the interface of .%B Issue 3 (and .%B Issue 2 , presumably, it's hinted it used a draft ("IEEE P1003.1 Trial Use Standard (April 1986)" \(en .%B Issue 3 Volume 1 , Referenced Documents, p. xii)). .Pp "{_POSIX_VDISABLE}" is defined as .Bd -filled -compact -offset 4n Terminal special characters defined in \fB\fP \(sc7.1.2 can be disabled using this character value, if it is defined. See \fItcgetattr\fP() and \fItcsetattr\fP() \(sc7.2.1. .Ed which is as present-day \(em .Rs .%B IEEE Standard Portable Operating System Interface for Computer Environments 1003.1 POSIX .\" Honestly the cover is so hard to parse .%C 345 East 47th Street, New York, NY 10017, USA .%D August 22, 1988 .%N SH12211 .%N IEEE Std 1003.1-1988 .%N FIPS PUB 151-1 .%N ISBN 1-55937-003-3 .%O \fBTable 2-9.\fP Execution-Time Symbolic Constants .%P p. 48 .%Q The Institute of Electrical and Electronics Engineers, Inc .\" https://nvlpubs.nist.gov/nistpubs/Legacy/FIPS/fipspub151-1.pdf .%U https://nvlpubs.nist.gov/\:nistpubs/\:Legacy/\:FIPS/\:fipspub151-1.pdf .Re .Pp And "{_POSIX_JOB_CONTROL}" as "If this symbol is defined, it indicates that the implementation supports job control." ibid., \fBTable 2-8.\fP Compile-Time Symbolic Constants \(em this is echoed through .Fn setpgid (ibid., 4. Process Environment, 4.3 Process Groups., 4.3.3 Set Process Group ID for Job Control.), .Fn tcgetpgrp (ibid., 7. Device- and Class-Specific Functions, \fB7.2 General Terminal Interface Control Functions.\fP, 7.2.3 Get Foregroud Process Group ID., p. 139), and .Fn tcsetpgrp (ibid., 7.2.4 Set Foregroud Process Group ID.), all of which are allowed to .Er ENOSYS out if job control is not implemented. .Pp Job control is defined succinctly (ibid., 2, \fB2.3 General Terms.\fP, \fBjob control.\fP, p. 31) as .Bd -filled -compact -offset 4n A facility that allows users to selectively stop (suspend) the execution of \fIprocesses\fP and contiue (resume) their execution at a later point. The user typically employs this facility via the interactive interface jointly supplied by the terminal I/O driver and a command interpreter. \fIConforming implementations\fP may optionally support \fIjob control\fP facilities; the presence of this option is indicated to the application at compile time or run time by the definition of the {_POSIX_JOB_CONTROL} symbol; see \fBSymbolic Constants\fP \(sc2.10). .Ed This agrees with .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 more so than .At V.2 , and this is confirmed in .%B IEEE Std 1003.1-1988 , Appendix B. Rationale and Notes, B.2 Definitions and General Requirements., \fBB.2.3 General Terms.\fP, \fBjob control.\fP (pp. 197-201; yes, four and a half pages), Implementing Job Control Systems, para. 1 (p. 200): .Bd -filled -compact -offset 4n The intent in adding 4.2\*[doc-Tn-font-size]BSD\s0-style \fIjob control\fP functionality was to adopt the nedessary 4.2\*[doc-Tn-font-size]BSD\s0 programmatic interface with only minimal changes to resolve syntactic or semantic conflicts with System V or to close recognized security holes. .Ed .Pp Indeed, it's much more useful to look at the interface through the lens of the rationale \(em ibid., \fBB.7 Device- and Class-Specific functions.\fP (pp. 258-265) Appendix B. Rationale and Notes, \fBB.7 Device- and Class-Specific functions.\fP \(em "After considerable debate, a structure similar to, but more flexible than, the \*[doc-Tn-font-size]AT&T\s0 System III \fItermio\fP was agreed upon. The format of that structure, referred to as the \fItermios\fP structure, has formed the basis for the current section.", and brings with it in particular new .Fn tc\fR*\fP Ns -group functions which universally replace the traditional .Fn ioctl agglomeration: .Fn tcsettattr for .Dv TCSETA (and the rest, but unnoted; see below) and .Nm tc Ns Bo Nm gs Bc Ns Fn etpgrp for .Dv TIOC Ns Bo Dv GS Bc Ns Dv PGPRP (ibid., \fBB.7.2 General Terminal Interface Control Functions.\fP, \fBB.7.2.3 Get Foreground Process Group ID.\fP and \fBB.7.2.4 Set Foreground Process Group ID.\fP, p. 265; "except for the additional security restriction that the referenced terminal must be the controlling terminal for the calling process" for both and "the specified new process group must be currnetly in use in the caller's session" for the latter), since they allow for full (any) type-checking, and for "networked implementations" it's impossible to pass arbitrary .Fn ioctl Ns s through, since "only the device driver knows for sure" in which direction data flows (ibid., B.7, paras. 9-15, p. 259). .Pp .Bd -filled -compact -offset 4n The standard specifies taht if an attempt to set the input baud rate to zero is made by \fIcfsetispeed\fP(), the input baud rate will be instead set to the output baud rate by \fIcfsetispeed\fP(). This allows implementations to provide tsupport for split baud rates or not. .Ed which is a bit of a cop-out (and, frankly, frivolous, since no-one has ever used them) in conjunction with .Bd -filled -compact -offset 4n In historical implementations, the baud rate information is traditionally kept in \fIc_cflag\fP. Applications should be written to presume that this might be the case (and thus not blindly copy \fIc_cflag\fP) but not to rely on it, in case it is in some other field of the structure. Settinf the \fIc_cflag\fP field absolutely after setting a baud rate is a bad idea because of this. .Ed (ibid., \fBB.7.1 General Terminal Interface.\fP, B.7.1.2 Settable Prameters., \fBB.7.1.2.7 Baud Rate Functions.\fP, p. 264); note also that "traditionally" starts at .At III , which'd successfully shed the "just put device registers" day-one legacy, which is .Em re- Ns introduced , if anything. .Pp Ibid., \fBB.7.1.2.6 Special Control Characters.\fP(!, p. 263) concedes that "Permitting \*[doc-Tn-font-size]VMIN\s0 and \*[doc-Tn-font-size]VTIME\s0 to overlap with \*[doc-Tn-font-size]VEOF\s0 and \*[doc-Tn-font-size]VEOL\s0 was a compromise", and that "Only when backwards compatibility of object code is a serious concern to an implementor should an implementation continue this practice.". Indeed, why .At III did it, besides saving two bytes, is a mystery. .Pp Similarly, .Bd -filled -compact -offset 4n The alternate behavior possible when ECHOK or ECHOE are specified with ICANON is permitted as a cmpromise depending on what the actual hardware can do. Erasing characters and lines is preferred, but is not always possible. .Ed (ibid., \fBB.7.1.2.5 Local Modes.\fP), and .Bd -filled -compact -offset 4n Although a more optimal structure for implementations may be possible, the degree of change to applications would be significantly larger. .Ed (ibid., \fBB.7.1.2.1\fP \fItermios\fP \fBStructure.\fP, p. 262). .Pp The removal of all .Fa c_oflag values sans .Dv OPOST (ibid., 7, \fB7.1 General Terminal Interface.\fP, 7.1.2 Settable Parameters., \fB7.1.2.3 Output Modes.\fP, p. 129) is rationalised as "There is nothing that a a portable application should do to its output for a terminal because that would require knowledge of the operation of the terminal. It is the responsibility of the operating system to provide postprocessing appropriate to the output device", and "Extensions to the standard to control the type of postprocessing already exist, and are expected to continue into the future. The control of these featrures is primarily to adjust the interface between the system and the terminal device so the output appears on the display correctly. This should be set up before use by any application."\& (ibid., Appendix B, B.7, B.7.1, B.7.1.2, \fBB.7.1.2.3 Output Modes.\fP, p. 263). .Pp .Dv VERASE is explicitly intended to erase by character, with proper handling of multibyte characters; at time of writing (appx. 34 years after this publication) a survey of common implementations reveals that this holds for Linux .\" {Free,Net,Open}BSD, Illumos, Linux (Bullseye) (if .Sy iutf8 and input is UTF-8) and .Em almost the illumos gate (which nevertheless fails). .\" https://twitter.com/nabijaczleweli/status/1578878951379779584 Analogously, .Fa t_werasc , spelled "4.3\*[doc-Tn-font-size]BSD\s0"'s "\*[doc-Tn-font-size]WERASE\s0 character", .Bd -filled -compact -offset 4n has not been specified in the standard because it is difficult to define in the international environment. It is only useful for languages were words are delimited by blanks In some idoegraphic languages, such as Japanese and Chinese, words are not delimited at all. The \*[doc-Tn-font-size]WERASE\s0 character should presumably take one back to the beginning of a sentence in those cases: practically, this means it would not get much use for those languages. .Ed (ibid., B.7.1.1 Interface Characteristics., \fBB.7.1.1.6 Canonical Mode Input Processing.\fP, p. 262). .Pp Minutiae realign .Bx 4.2 job control edge cases (orphan processes .Er EIO Ns ing instead of being killed) with present-day semantics (ibid., \fBB.7.1.1.4 Terminal Access Control.\fP, p. 261, cf. ibid., 6. Input and Output Primitives, 6.4 Input and Output., 6.4.2 Write to a File., \fB6.4.2.4 Errors.\fP, p. 115). .Pp While "normal" controlling teletype allocation .Pq Nm getty is outside the scope of the standard, .Fn open isn't, so in another compromise; .Bd -filled -compact -offset 4n The Working Group did not wish to require the traditional behavior, because it is not very straightforward or flexible for either implementations or applications. However, because of its prevalence, it was not practical to disallow this behavior either. .Ed So .Dv O_NOCTTY is created "to allow applicaitons to avoid unintentionally acquiring a controlling terminal as a side-effect of opening a terminal file.", as present-day \(em ibid., Appendix B, \fBB.5 Files and Directories.\fP, \fBB.5.3 General File Creation.\fP, \fBB.5.3.1 Open a File.\fP, para. 7, p. 244; ibid., B.7, B.7.1, B.7.1.1, \fBB.7.1.1.3 The Controlling Terminal.\fP, pp. 260-261. .Pp "The issue of modem control was excluded from \*[doc-Tn-font-size]POSIX\s0" because Europeans didn't care (ibid., B.7, paras. 16-19, p. 260). It's unclear what this refers to. .Pp It definitely shows why "This section has probably undergone more debate and revision than any other in the standard." (ibid., B.7, p. 258)! .Pp With this in mind, it is now prudent to look at the re-defined teletype interface, unsullied by hard compatibility. Chapter 7 \(em ibid., pp. 123-140 \(em is indeed most similar to .%B Release 3.0 .Xr tty 4 , in that it also describes the controlling teletype and doesn't contain .Sy swtch . Of course, the new .Dv O_NONBLOCK flag is explicitly noted as equivalent to .Dv CLOCAL for .Fn open (\c .%B IEEE Std 1003.1-1988 , 7., 7.1, 7.1.1. Interface Characteristics., \fB7.1.1.1 Opening a Terminal Device File.\fP. para. 2, p. 123), "If the implementation supports job control (if {_POSIX_JOB_CONTROL} is defined", "A terminal may have a foreground process group associated with it" which is what plays the "special role" for signal-generating characters instead of the "control terminal", and .Nm tc Ns Bo Nm gs Bc Ns Nm etpgrp Ns () and .Fn setsid , rather than .Bo Nm gs Bc Ns Nm etpgrp Ns () , are meaningful in controlling it (ibid., \fB7.1.1.2 Process Groups.\fP) (and .Dv O_NOCTTY prevents it allocation; ibid., \fB7.1.1.3 The Controlling Terminal.\fP, p. 124). .Pp Conversely, ibid., \fB7.1.1.4 Terminal Access Control.\fP inserts the .%B 4.2 Berkeley Software Distribution phonotactics governing .Dv SIGTTIN Ns / Ns Dv SIGTTOU and .Dv TOSTOP for background process groups doing I/O or teletype mode control. .Pp "{MAX_CHAR} in early drafts" of the standard is re-spelled as "{MAX_INPUT}" for obvious reasons (ibid., Appendix B, B.2, \fBB.2.9 Numerical Limits.\fP, B.2.9.5 Pathname Variable Values), and .Bd -filled -compact -offset 4n The system may impose a limit, {MAX_INPUT}, on the number of bytes that may be stored i nthe input queue. The behavior of the system when the limit is exceeded is implementation-defined. .Ed Similarly, for all of the .Fa c_ Ns Bo Fa iocl Bc Ns Fa flag and .Fa c_cc fields, the default values are implementation-defined (ibid., 7, 7.1, 7.1.1, \fB7.1.1.5 Input Processing and Reading Data.\fP, p. 125). .Pp "If {MAX_CANON} is defined for this terminal device, it is a limit on the number of bytes in a line."\& with implementation-defined results if overrun (ibid., \fB7.1.1.6 Canonical Mode Input Processing.\fP, para. 2). The only new thing about these limits is nomenclature \(em the Minimum Value (prefixed with .Li _POSIX_ ) is .Sy 255 for both (notably, .Sy 1 less than heretofor documented; ibid., \fBTable 2-5.\fP Pathnale Variable Values, p. 46; ibid., \fBTable 2-2.\fP Minimum Values, p. 45). .Pp For .Sy \-icanon , when setting .Sy min > {MAX_INPUT}, "the response to the request" is explicitly implementation-defined (even though it falls out of the usual definition for this limit; ibid., Appendix B, 7, 7.1, 7.1.1, \fB7.1.1.7 Non-Canonical Mode Input Processing.\fP, p. 126), and the .Sy min time interactions are editorialised to twice the volume, but remain at no functional change (ibid., \fB7.1.1.7.1\fP-\fB7.1.1.7.4\fP, pp. 126-127). .Pp Ibid., \fB7.1.1.9 Special Characters.\fP (pp. 127-128) are, naturally, editorialised, with the targets for .Sy intr quit now being the same as for .Sy susp (below), and see the addition of: .TS l4zw0 l2 lx . \*[doc-Tn-font-size]SUSP\s0 T{ If job control is supported (see \fBSpecial Control Characters\fP \(sc7.1.2.6), the \*[doc-Tn-font-size]SUSP\s0 special character is recognized on input. If the \*[doc-Tn-font-size]ISIG\s0 flag is enabled, receipt of the \*[doc-Tn-font-size]SUSP\s0 character causes a \*[doc-Tn-font-size]SIGTSTP\s0 signal to be sent to all processes in the foreground process group for which the terminal is the controlling terminal, and the \*[doc-Tn-font-size]SUSP\s0 character is discarded when processed. T} \*[doc-Tn-font-size]CR\s0 T{ Special character on input and is recognized if the \*[doc-Tn-font-size]ICANON\s0 flag is set; it is the '\f(CR\er\fP'. When \*[doc-Tn-font-size]ICANON\s0 and \*[doc-Tn-font-size]ICRNL\s0 are set and \*[doc-Tn-font-size]IGNCR\s0 is not set, this character is translated into a \*[doc-Tn-font-size]NL\s0, and has the same effect as a \*[doc-Tn-font-size]NL\s0 character. T} .TE "It is implementaiton-defined whether the \*[doc-Tn-font-size]START\s0 and \*[doc-Tn-font-size]STOP\s0 characters can be changed." \(em this covers both \(>=\c .%B Release 3.0 and \(>=\c .%B Seventh Edition ; but "The values for \*[doc-Tn-font-size]INTR\s0, \*[doc-Tn-font-size]QUIT\s0, \*[doc-Tn-font-size]ERASE\s0, \*[doc-Tn-font-size]KILL\s0, \*[doc-Tn-font-size]EOF\s0, \*[doc-Tn-font-size]EOL\s0, and \*[doc-Tn-font-size]SUSP\s0 (job control only), shall be changeable to suit individual tastes.". "If {_POSIX_VDISABLE} is in effect for the terminal file" (\c .Oo Nm f Oc Ns Nm pathconf Ns Pq Dv _PC_VDISABLE isn't .Sy \-1 : .%B IEEE Std 1003.1-1988 , \fBTable 5-2.\fP Configurable Pathname Variables, p. 105), "special character functions associated with changeable special control characters can be disalbed individually", as present-day; if any two overlap, it's "undefined" what happens. Provisions are made for context-based disambugation, like: "an implementation may define multibyte sequences that have a meaning different from the meaning of the bytes when considered individually." if .Sy iexten ; the example is a red herring \(em this provision is actually for .Sy \e Ns -escaping .Sy erase kill eof , allowing for preservation of historical behaviour. .Pp Ibid., 7, 7.1, 7.1.1, \fB7.1.1.10 Modem Disconnect.\fP (p. 128) concretifies hangup \(AN .Sy \-clocal \(rA .Dv SIGHUP , retains subsequent .Fn read Ns s returning empty, and defines subsequent .Fn write Ns s to .Dv EIO \(en this appears to be new behaviour. .Pp .Dv HUPCL is defined to take place after committing all output and flushing input, rather than instantly: this is the same behaviour as .%B Release 3.0 , but undocumented (\c .%B IEEE Std 1003.1-1988 , 7, 7.1, 7.1.1, \fB7.1.1.11 Closing a Terminal Device File.\fP). .Pp Ibid., 7.1.2, 7.1.2.1-7.1.2.6, incl. \fBTable 7-1\fP-\fBTable 7-5\fP (pp. 129-134) correspond to the bulk of the remainder of .Xr tty 4 , and are reproduced faithfully below. .Pp .TS center; c s s s l c c c c c c c c l l l l li l li l . \fBTable 7-1.\fP \fItermios\fP Structure .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Member Array Member Description Type Size Name \^ \_ \_ \_ \_ tcflag_t c_iflag Input modes tcflag_t c_oflag Output modes tcflag_t c_cflag Control modes tcflag_t c_lflag Local modes cc_t \*[doc-Tn-font-size]NCCS\s0 c_cc Control characters .TE Where both types are "unsigned integral types" (as present-day, with the missing requirement of being smaller than a .Vt long ) , and the structure not being limited to these members. .Pp .TS center; c s l c c c c l l . \fBTable 7-2.\fP \fItermios c_iflag\fP Field .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Mask Description Name \^ \_ \_ \*[doc-Tn-font-size]BRKINT\s0 Signal interrupt on break. \*[doc-Tn-font-size]ICRNL\s0 Map \*[doc-Tn-font-size]CR\s0 to \*[doc-Tn-font-size]NL\s0 on input. \*[doc-Tn-font-size]IGNBRK\s0 Ignore break condition. \*[doc-Tn-font-size]IGNCR\s0 Ignore \*[doc-Tn-font-size]CR\s0. \*[doc-Tn-font-size]IGNPAR\s0 Ignore characters with parity errors. \*[doc-Tn-font-size]INLCR\s0 Map \*[doc-Tn-font-size]NL\s0 to \*[doc-Tn-font-size]CR\s0 on input. \*[doc-Tn-font-size]INPCK\s0 Enable input parity check. \*[doc-Tn-font-size]ISTRIP\s0 Strip character. \*[doc-Tn-font-size]IXOFF\s0 Enable start/stop input control. \*[doc-Tn-font-size]IXON\s0 Enable start/stop output control. \*[doc-Tn-font-size]PARMRK\s0 Mark parity errors. .TE Sans the removal of .Dv IUCLC (since characters are possibly multi-byte) and .Dv IXANY (unnoted, likely just doesn't really matter) the table is unchanged. .Pp Long break conditions are explicitly amalgamated (cf. ibid., Appendix B, B.7, B.7.1, B.7.1.2, \fBB.7.1.2.2 Input Modes.\fP, p. 263), and, if .Sy \-ignbrk brkint , clear I/O queues and .Dv SIGINT the foreground process group (the former is unnoted in .%B Release 3.0 , nor is the target of the latter). .Pp .Dv VSTART and .Dv VSTOP are only allowed to be discarded from the input if .Sy ixon (rather than always). The wording doesn't change, other than by omission, so .Sy ixon is allowed to function in either .Oo Sy \- Oc Ns Sy ixany mode. .Pp .Dv IXOFF is described more verbosely and explicitly mentions {MAX_INPUT}, but "The precise conditions under which \*[doc-Tn-font-size]STOP\s0 and \*[doc-Tn-font-size]START\s0 characters are transmitted are implementation-defined.". .Pp \fB7.1.2.3. Output Modes.\fP .TS center; c c c c l l l l li l . Mask Description Name \^ \_ \_ \*[doc-Tn-font-size]OPOST\s0 Perform output processing. .TE "If \*[doc-Tn-font-size]OPOST\s0 is set, output data is processed in an implementation-defined fashion so that lines of text are modified to appear appropriately on the terminal device, otherwise characters are transmitted without change.", see above. .Pp .TS center; c s l c c c c l l . \fBTable 7-3.\fP \fItermios c_cflag\fP Field .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Mask Description Name \^ \_ \_ \*[doc-Tn-font-size]CLOCAL\s0 Ignore modem status lines. \*[doc-Tn-font-size]CREAD\s0 Enable receiver. \*[doc-Tn-font-size]CSIZE\s0 Number of bits per byte*: \0\0CS5 \0\05 bits \0\0CS6 \0\06 bits \0\0CS7 \0\07 bits \0\0CS8 \0\08 bits \*[doc-Tn-font-size]CSTOPB\s0 Send two stop bits, else one. \*[doc-Tn-font-size]HUPCL\s0 Hang up on last close. \*[doc-Tn-font-size]PARENB\s0 Parity enable. \*[doc-Tn-font-size]PARODD\s0 Odd parity, else even. .TE .\" There's a ~2mm gap under CS8. idk \r\l'8' .br \r*\h'1m'CSIZE has historically described "character" size. .br See above for the reasoning for moving speeds, or below for the new list. .Pp Oddly, .Dv CREAD is not rephrased in terms of bytes. .br If .Sy hupcl , "The modem connection shall be broken."\& when the last file descriptor is closed. .br Despite the age of this publication, provisions are made: .Bd -filled -compact -offset 4n If the object for which the control modes are set is not an asynchronous serial connection, some of the modes may be ignored; for example, if an attempt is made to set the baud rate on a network connection to a terminal on another host, the baud rate may or may not be set on the connection between that terminal and the machine it is directly connected to. .Ed .Pp .TS center; c s l c c c c l l l l . \fBTable 7-4.\fP \fItermios c_lflag\fP Field .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Mask Description Name \^ \_ \_ \*[doc-Tn-font-size]ECHO\s0 Enable echo. \*[doc-Tn-font-size]ECHOE\s0 Echo \*[doc-Tn-font-size]ERASE\s0 as an error-correcting backspace. \*[doc-Tn-font-size]ECHOK\s0 Echo \*[doc-Tn-font-size]KILL\s0. \*[doc-Tn-font-size]ECHONL\s0 Echo '\f(CR\en\fP'. \*[doc-Tn-font-size]ICANON\s0 Canonical input (erase and kill processing). \*[doc-Tn-font-size]IEXTEN\s0 Enable extended (implementation-defined) functions. \*[doc-Tn-font-size]ISIG\s0 Enable signals. \*[doc-Tn-font-size]NOFLSH\s0 Disable flush after interrupt, quit, or suspend. \*[doc-Tn-font-size]TOSTOP\s0 Send \*[doc-Tn-font-size]SIGTTOU\s0 for background output. .TE .Dv XCASE is replaced with .Dv IEXTEN ; .Dv ISIG and .Dv NOFLSH expectedly mention "\*[doc-Tn-font-size]SUSP\s0 (job control only)". The .Dv TOSTOP description matches the .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 .Dv LTOSTOP one verbatim. .Pp .Dv IEXTEN is fully defined as .Bd -filled -compact -offset 4n If \*[doc-Tn-font-size]IEXTEN\s0 is set, implementation-defined functions shall be recognized from the input data. It is implementation-defined how \*[doc-Tn-font-size]IEXTEN\s0 being set interacts with \*[doc-Tn-font-size]ICANON\s0, \*[doc-Tn-font-size]ISIG\s0, \*[doc-Tn-font-size]IXON\s0, or \*[doc-Tn-font-size]IXOFF\s0. If \*[doc-Tn-font-size]IEXTEN\s0 is not set, then implementation-defined functions shall not be recognized and the cooresponding input characters shall be processed for \*[doc-Tn-font-size]ICANON\s0, \*[doc-Tn-font-size]ISIG\s0, \*[doc-Tn-font-size]IXON\s0, and \*[doc-Tn-font-size]IXOFF\s0. .Ed .Pp The description for .Dv TOSTOP derives heavily from the .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 one as well (though, naturally, process groups aren't "distinguished" any-more). .Pp .Dv ECHO is not rephrased in terms of bytes. .br .Dv ECHOE .Bd -filled -compact -offset 4n shall cause the terminal to erase the last character in the current line from the display, if possible. If there is no character to erase, an implementaion may echo an indication that this was the case or do nothing. .Ed if .Sy icanon \(em this allows for the .%B Release 3.0 behaviour of .Sy icanon echo echok yielding .Qq Li \eb\ \eb and .Sy icanon \-echo echok .Qq Li \ \eb . .\" TODO? i could swear there were systmes that echoed like a ! or rung a bell for erasing at start-of-line .br If .Sy icanon , .Dv ECHOK is allowed to either "erase the line from the display" \(em like .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 .Dv LCRTKIL \(em or "echo the '\f(CR\en\fP' character after the \*[doc-Tn-font-size]KILL\s0 character" \(em like .%B Release 3.0 . .Pp .TS center; c s s l c s c c c c2 c2 c l l l . \fBTable 7-6.\fP \fItermios c_cc\fP Special Control Characters .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Subscript Usage \*[doc-Tn-font-size]Canonical\s0 \*[doc-Tn-font-size]Non-Canonical\s0 Description \*[doc-Tn-font-size]Mode\s0 \*[doc-Tn-font-size]Mode\s0 \^ \_ \_ \_ \*[doc-Tn-font-size]VEOF\s0 \*[doc-Tn-font-size]EOF\s0 character \*[doc-Tn-font-size]VEOL\s0 \*[doc-Tn-font-size]EOL\s0 character \*[doc-Tn-font-size]VERASE\s0 \*[doc-Tn-font-size]ERASE\s0 character \*[doc-Tn-font-size]VINTR\s0 \*[doc-Tn-font-size]VINTR\s0 \*[doc-Tn-font-size]INTR\s0 character \*[doc-Tn-font-size]VKILL\s0 \*[doc-Tn-font-size]KILL\s0 character \*[doc-Tn-font-size]VMIN\s0 \*[doc-Tn-font-size]MIN\s0 value \*[doc-Tn-font-size]VQUIT\s0 \*[doc-Tn-font-size]VQUIT\s0 \*[doc-Tn-font-size]QUIT\s0 character \*[doc-Tn-font-size]VSUSP\s0 \*[doc-Tn-font-size]VSUSP\s0 \*[doc-Tn-font-size]SUSP\s0 character \*[doc-Tn-font-size]VTIME\s0 \*[doc-Tn-font-size]TIME\s0 value \*[doc-Tn-font-size]VSTART\s0 \*[doc-Tn-font-size]VSTART\s0 \*[doc-Tn-font-size]START\s0 character \*[doc-Tn-font-size]VSTOP\s0 \*[doc-Tn-font-size]VSTOP\s0 \*[doc-Tn-font-size]STOP\s0 character .TE "Implementations that do not support job control may ignore the \*[doc-Tn-font-size]SUSP\s0 character value in the \fIc_cc\fP array indexed by the \*[doc-Tn-font-size]VSUSP\s0 susbscript.", and similarly for .Sy start stop , but for them they "shall return the value in use when \fItcgetattr\fP is called.". .Pp Even if disabling is supported and enabled, "If \*[doc-Tn-font-size]ICANON\s0 is not set, the value of \*[doc-Tn-font-size]{_POSIX_VDISABLE}\s0 has no special meaning for the \*[doc-Tn-font-size]VMIN\s0 and \*[doc-Tn-font-size]VTIME\s0 entries of the \fIc_cc\fP array.". .Pp Speed control is moved to the appropriately-named .%B IEEE Std 1003.1-1988 , 7, 7.1, 7.1.2, \fB7.1.2.7 Baud Rate Functions.\fP (pp. 134-135), with .Nm cf Ns Bo Nm gs Bc Ns Nm et Ns Bo Nm io Bc Ns Fn speed \(em these either take or return .Vt speed_t (defined the same way as .Vt tcflag_t ) . The only surprising part is that .Nm cfsetispeed Ns Pq Dv B0 sets the input speed to be the same as the output speed, and only .Nm cfsetospeed Ns Pq Dv B0 actually hangs up. The pre-defined speeds follow. .Pp .TS center; c s s s s l c c l9zw0 c c c c l c c l l l l l l l l l l . \fBTable 7-6.\fP \fItermios\fP Baud Rate Values .\" TODO: these are extraneous and should just be empty lines, but mandoc is broken .\" https://inbox.vuxu.org/mandoc-discuss/20220906122412.5noxbtocludm3tn6@tarta.nabijaczleweli.xyz/T/#u \ \& Name Description Name Description \_ \_ \_ \_ B0 Hang up B600 600 baud B50 50 baud B1200 1200 baud B75 75 baud B1800 1800 baud B110 110 baud B2400 2400 baud B134 134.5 baud B4800 4800 baud B150 150 baud B9600 9600 baud B200 200 baud B19200 19\|200 baud B300 300 baud B38400 38\|400 baud .TE .Pp Ibid., 7.2, \fB7.2.1 Get and Set State.\fP (pp. 136-137) provides .Fn tcgetattr as an equivalent for .Nm ioctl Ns Pq Dv TCGETA and .TS l4zw0 l1 l1 l . \*[doc-Fn-font]tcsetattr\fP(\*[doc-Dv-font]TCSANOW\fP) for \*[doc-Fn-font]ioctl\fP(\*[doc-Dv-font]TCSETA\fP), \*[doc-Fn-font]tcsetattr\fP(\*[doc-Dv-font]TCSADRAIN\fP) for \*[doc-Fn-font]ioctl\fP(\*[doc-Dv-font]TCSETAW\fP), and \*[doc-Fn-font]tcsetattr\fP(\*[doc-Dv-font]TCSAFLUSH\fP) for \*[doc-Fn-font]ioctl\fP(\*[doc-Dv-font]TCSETAF\fP). .TE Descriptions for the former decidedly mirror those for the latter. . .Ss UNIX\(rg System V Release 4 "login id" becomes "login ID"; "common terminal speeds" are now "300, 1200, 2400, 4800, 9600, 19200, and 38400 baud" \(em .Rs .%B UNIX\(rg System V Release 4 User's Reference Manual .%D 1990 .%N ISBN 0-13-947037-9 .%O Introduction, How to Get Started, Logging \&In .%P para. 1, p. 4 .%Q AT&T: UNIX Software Operation .\" http://bitsavers.org/pdf/att/unix/System_V_Release_4/0-13-947037-9_Unix_System_V_Rel4_Users_Reference_Manual_1990.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_4/\:0-13-947037-9_\:Unix_\:System_V_\:Rel4_\:Users_\:Reference_\:Manual_\:1990.pdf .Re .Pp The special-character spelling is updated to the more reasonable "\*[doc-Tn-font-size]CTRL-s\s0" (ibid., How to Communicate Through Your Terminal, para. 4, p. 6). .Pp Unfortunately, "The shell layer manager continues to be supported in Release 4.0.", but "Release 4.0 offers an optional shell (\f(CRjsh\fP) that features a new implementation of job control that conforms to the POSIX standard." .Pq of course, Nm csh Ns " and" the KornShell are also available, but the former is far cry from normal- Ns Nm sh Ns -but-with-job-control \(em .Rs .%B UNIX\(rg System V Release 4 Migration Guide .%D 1990 .%N ISBN 0-13-933821-7 .%O 3. Migrating from Release 2, Release 2.0 Features, Shell Engancements (Job Control) .%P p. 3-3 .%Q AT&T: UNIX Software Operation .\" http://bitsavers.org/pdf/att/unix/System_V_Release_4/0-13-933821-7_Unix_System_V_Rel4_Migration_Guide_1990.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_4/\:0-13-933821-7_\:Unix_\:System_V_\:Rel4_\:Migration_\:Guide_\:1990.pdf .Re .Pp Worryingly, however, .Bd -filled -compact -offset 4n In Release 4.0, the entire terminal (tty) subsystem in the kernel has been rewritten to use the STREAMS mechanism. The move to a STREAMS implementation increases the modularity of the tty subsystem and procides a more flexible framework for future enchancements. Pseudo-ttys (ptys) have been implemented under STREAMS as well. .Ed And the same happens to pipes. (Ibid., 5. UNIX System V Release 4, Input/Output, STREAMS, p. 5-21) .Pp .Xr login 1 loses provisions for the "second \(Fcdialup\(Fo password", but .Bd -filled -compact -offset 4n If you make five incorrect login attempts, all five may be logged in \f(CR/var/adm/loginlog\fP (if it exists) and the TTY line will be dropped. .Ed If the "first line of input" (actually just the login-name-and-environment line, so not if invoked from .Nm getty ) doesn't contain a lower-case character, "the port's \f(CRtermio\fP(7) options" are set to for an upper-case-only terminal (\c .%B UNIX\(rg System V Release 4 User's Reference Manual , pp. 272-273). These match .Nm getty for .Sy iuclc olcuc xcase , at least so says my good friend Juliano \(em .Rs .%O \*[doc-Pa-font]ATT-SYSVr4/cmd/login/login.c\fP .%R UNIX SYSVr4 Source Code .\" https://vetusware.com/download/UNIX%20SYSVr4%20Source%20Code%20r4/?id=11573 .%U https://vetusware.com/\:download/\:UNIX%20SYSVr4%20Source%20Code%20r4/\:?id=11573 .Re .Pp Opposite the title page, an .Sx ACKNOWLEDGEMENT is found in both .%B UNIX\(rg System V Release 4 User's Reference Manual and .Rs .%B UNIX\(rg System V Release 4 Programmer's Reference Manual .%D 1990 .%N ISBN 0-13-947029-8 .%Q Unix System Laboratories, Inc., A Subsidiary of AT&T or AT&T: UNIX Software Operation .\" http://bitsavers.org/pdf/att/unix/System_V_Release_4/0-13-947029-8_Unix_System_V_Rel4_Programmers_Reference_Manual_1990.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_4/\:0-13-947029-8_\:Unix_\:System_V_\:Rel4_\:Programmers_\:Reference_\:Manual_\:1990.pdf .Re .Bd -filled -compact -offset 4n AT&T gratefully acknowledges the X/Open Company Limited for permission to reproduce portions of its copyrighted \fIX/Open Portability Guide, Issue 3\fP. .Ed .Pp Indeed: insofar as the .Tn C interface, .Xr termios 2 (ibid., pp. 359-362), described succinctly as .Bd -filled -compact -offset 4n .Nm termios : tcgetattr , tcsetattr , tcsendbreak , tcdrain , tcflush , tcflow , cfgetospeed , cfgetispeed , tcsetispeed , cfsetospeed , tcgetpgrp , tcsetpgrp , tcgetsid \(en general terminal interface .Ed corresponds directly, down to the section names included verbatim, to .%B IEEE Std 1003.1-1988 \(sc7.1.2.7-\(sc7.2.4.4 , with the only addition being .Bd -literal -compact -offset 4n \s[+0.5]\fBGet Terminal Session ID\fP\s0 \h'\w'\s+1\fBGet\fP\s0'u'\f(CRtcgetsid\fP\fR returns the session ID of the terminal specified by \fP\fIfildes\fP\fR.\fP .Ed which doesn't correspond to any .Tn POSIX function, and appears to be the counterpart to .Fn setsid (ibid., 4, 4.3, 4.3.2 Create Session and Set Process Group \*[doc-Tn-font-size]ID\s0., p. 75) which lives in .Xr setsid 2 (\c .%B UNIX\(rg System V Release 4 Programmer's Reference Manual , p. 318) and also copies the text verbatim, including some from Appendix B. .Pp .Xr termio 7 is generalised slightly to the .%B IEEE Std 1003.1-1988 symbolic limits, "control terminal" becomes "controlling terminal", and daemonisation is achieved by calling .Fn setsid to change session rather than .Fn setpgrp to change the "process grouo" \(em .Rs .%B UNIX\(rg System V Release 4 System Files and Devices Reference Manual \fIfor\fP Motorola Processors .%C 2900 South Diablo Way, Tempe, Arizona 85282 .%D 1993 .%N ISBN 0-13-035874-6 .%P pp. 381-395 .%Q AT&T .%Q UNIX System Laboratories, Inc. .%Q Motorola .\" http://bitsavers.org/pdf/att/unix/System_V_Release_4_Motorola/0-13-035874-6_Unix_System_V_Release_4_System_Files_and_Devices_Reference_Manual_for_Motorola_Processors_1993.pdf .%U http://bitsavers.org/\:pdf/\:att/\:unix/\:System_V_Release_4_Motorola/\:0-13-035874-6_\:Unix_\:System_V_\:Release_4_\:System_\:Files_\:and_\:Devices_\:Reference_\:Manual\:_\:for_\:Motorola_\:Processors_\:1993.pdf .Re .Pp In general, all mentions of layer-based "job control" are pruned, and the compatibility "System V \f(CRtermio\fP structure"'s .Sy icanon .Fa c_cc is laid out as .TS l4zw0 l lfCR l . 0 \*[doc-Tn-font-size]VINTR\s0 \*[doc-Tn-font-size]DEL\s0 1 \*[doc-Tn-font-size]VQUIT\s0 \*[doc-Tn-font-size]FS\s0 2 \*[doc-Tn-font-size]VERASE\s0 # 3 \*[doc-Tn-font-size]VKILL\s0 @ 4 \*[doc-Tn-font-size]VEOF\s0 \*[doc-Tn-font-size]EOT\s0 5 \*[doc-Tn-font-size]VEOL\s0 \*[doc-Tn-font-size]NUL\s0 6 \*[doc-Tn-font-size]VEOL2\s0 \*[doc-Tn-font-size]NUL\s0 7 \fRreserved\fP .TE (finally!), and .Dv LOBLK is lost, but .%B UNIX\(rg System V Release 4 User's Reference Manual continues to have provisions for it (and .Xr shl 1 ) , so it's unclear where exactly it's cut. .Pp Similarly, description of job control largely just adapts various parts of the scattered .%B IEEE Std 1003.1-1988 descriptions. Description of .Sy \-icanon is verbatim ibid., \(sc7.1.1.7 and all four subsections (pp. 126-127) (plus some flavour text from the corresponding rationale in \(scB.7.1.1.7 (p. 262)), but of .Sy icanon is once again generalised to say "The \*[doc-Tn-font-size]ERASE\s0 character (by default, the character #)" rather than "By default, the character #" (and likewise for .Sy kill ) . .\" not really for werase reprint! actually, that's "The REPRINT character (the character control-R)", but it's just legacy wording for erase kill .Sy werase is freshly defined as: .Bd -filled -compact -offset 4n The \*[doc-Tn-font-size]WERASE\s0 character (the character control-W) erases the last "word" typed in the current output line (but not any preceding spaces or tabs). A "word" is defined as a sequence of non-blank characters, with tabs counted as blanks. .Ed This is the .Em exact wording in ibid., \(scB.7.1.1.6 (p. 262). Similarly, .Bd -filled -compact -offset 4n The \*[doc-Tn-font-size]REPRINT\s0 character (the character control-R) prints a newline followed by all characters that have not been read. Reprinting also occurs automatically if characters that would normally be erased from the screen are fouled by program output. The characters are reprinted as if they were being echoed; consequencely, if \f(CRECHO\fP is not set, they are not printed. .Ed Being "fouled by" brands the first two sentences as good but nevertheless obvious adaptation of the .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 description. Being predicated on .Sy echo is undocumented there, but matches the actual behaviour (ibid., .Pa usr/src/sys/dev/ttynew.c , .Fn ntyretype , .Fn ntyecho ) . .Pp In the .Sx Special Control Characters summary, .Sy intr quit spell it "a \f(CRSIGQUIT\fP signal"/"a \f(CRSIGINT\fP signal" instead of "a \fIquit\fP signal"/"an \fIinterrupt\fP signal", but target "all frequent processes associated with the controlling terminal" (i.e., only "frequent" is added, and it's unclear how that makes it be job-controlly). .Sy erase kill finally correctly list .Sy eol2 as a character they won't erase past. .Pp The unchanged-since-\c .%B Release 3.0 .Sy eof trimming paragraph is moved up and extended with .Sy echoctl as .Bd -filled -compact -offset 4n The \*[doc-Tn-font-size]EOF\s0 character is not echoed unless it is escaped or \*[doc-Tn-font-size]ECHOCTL\s0 is set. Because \*[doc-Tn-font-size]EOT\s0 is the default \*[doc-Tn-font-size]EOF\s0 character, this prevents terminals that respond to \*[doc-Tn-font-size]EOT\s0 from hanging up. .Ed .Pp The "The start/stop characters can not be changed or escaped." sentence is lost. .Sy swtch is the only remnant of layer-based "job control"; its new description and the new synopses follow. .Pp .TS l2 lx . \*[doc-Tn-font-size]WERASE\s0 T{ (\*[doc-Tn-font-size]CTRL-W\s0 or \*[doc-Tn-font-size]ASCII ETX\s0) erases the preceding "word". It does not erase beyond the start of a line, as delimited by a \*[doc-Tn-font-size]NL\s0, \*[doc-Tn-font-size]EOF\s0, \*[doc-Tn-font-size]EOL\s0, or \*[doc-Tn-font-size]EOL2\s0 character. T} \*[doc-Tn-font-size]REPRINT\s0 T{ (\*[doc-Tn-font-size]CTRL-R\s0 or \*[doc-Tn-font-size]ASCII DC2\s0) reprints all characters, preceded by a newline, that have not been read. T} \*[doc-Tn-font-size]SWTCH\s0 T{ (\*[doc-Tn-font-size]CTRL-Z\s0 or \*[doc-Tn-font-size]ASCII EM\s0) is used only when \f(CRshl\fP layers is invoked. T} \*[doc-Tn-font-size]SUSP\s0 T{ (\*[doc-Tn-font-size]CTRL-Z\s0 or \*[doc-Tn-font-size]ASCII SUB\s0) generates a \f(CRSIGTSTP\fP signal. \f(CRSIGTSTP\fP stops all processes in the foreground process group for that terminal. T} \*[doc-Tn-font-size]DSUSP\s0 T{ (\*[doc-Tn-font-size]CTRL-Y\s0 or \*[doc-Tn-font-size]ASCII EM\s0) generates a \f(CRSIGTSTP\fP signal as \*[doc-Tn-font-size]SUSP\s0 does, but the signal is sent when a process in the foreground process group attempts to read the \*[doc-Tn-font-size]DSUSP\s0 character, rather than when it is typed. T} \*[doc-Tn-font-size]DISCARD\s0 T{ (\*[doc-Tn-font-size]CTRL-O\s0 or \*[doc-Tn-font-size]ASCII SI\s0) causes subsequent output to be discarded. Output is discarded until another \*[doc-Tn-font-size]DISCARD\s0 character is typed, more input arrives, or the condition is cleared by a program. T} \*[doc-Tn-font-size]LNEXT\s0 T{ (\*[doc-Tn-font-size]CTRL-V\s0 or \*[doc-Tn-font-size]ASCII SYN\s0) causes the special meaning of the next character to be ignored. This works for all the special characters mentioned above. It allows characters to be input that would otherwise be interpreted by the system (for example, \*[doc-Tn-font-size]KILL, QUIT\s0). T} .TE .Pp The most obvious idiocy here is that .Sy ^ Ns Ar Z is SUB (that's even internally inconsistent!), and the .Dv CNSWTCH Ns / Ns Dv CSWTCH dichotomy is still there and it's .Em still initialised to .Dv CNSWTCH (\c .%B UNIX SYSVr4 Source Code , .Pa ATT-SYSVr4/uts/i386/sys/termios.h , .Pa ATT-SYSVr4/uts/i386/io/ldterm.c ) . .Pp These new .Sx Special Control Characters are all the same functionally and phonotactically as in .%B 4.2 Berkeley Software Distribution , sans the "\*[doc-Tn-font-size]DISCARD\s0" .Fa t_flushc spelling. .Pp .Dv _POSIX_VDISABLE is .Sy 0 , so .Sy eol eol2 swtch are all disabled by default (this also means that the default .Sy eol description continues to be wrong, but for a different reason this time, but oh well). .Pp .Sy \e Ns -escaping .Sy erase kill eof is mentioned again here and doesn't appear to be predicated on .Dv IEXTEN ; this is a very clear violation of the standard. .Pp .Vt "struct termios" consists only of the .Tn POSIX Ns -prescribed members, with .Vt tcflag_t and .Vt speed_t being .Vt unsigned\ long Ns s and .Vt cc_t an .Vt unsigned\ char ; the .Sy \-icanon .Fa c_cc listing is the same as for .Vt "struct termio" , but for .Sy icanon , expectedly, it grows to: .TS l4zw0 l lfCR l . 0 \*[doc-Tn-font-size]VINTR\s0 \*[doc-Tn-font-size]DEL\s0 1 \*[doc-Tn-font-size]VQUIT\s0 \*[doc-Tn-font-size]FS\s0 2 \*[doc-Tn-font-size]VERASE\s0 # 3 \*[doc-Tn-font-size]VKILL\s0 @ 4 \*[doc-Tn-font-size]VEOF\s0 \*[doc-Tn-font-size]EOT\s0 5 \*[doc-Tn-font-size]VEOL\s0 \*[doc-Tn-font-size]NUL\s0 6 \*[doc-Tn-font-size]VEOL2\s0 \*[doc-Tn-font-size]NUL\s0 7 \*[doc-Tn-font-size]VSWTCH\s0 \*[doc-Tn-font-size]NUL\s0 8 \*[doc-Tn-font-size]VSTRT\s0 \*[doc-Tn-font-size]DC1\s0 9 \*[doc-Tn-font-size]VSTOP\s0 \*[doc-Tn-font-size]DC3\s0 10 \*[doc-Tn-font-size]VSUSP\s0 \*[doc-Tn-font-size]SUB\s0 11 \*[doc-Tn-font-size]VDSUSP\s0 \*[doc-Tn-font-size]EM\s0 12 \*[doc-Tn-font-size]VREPRINT\s0 \*[doc-Tn-font-size]DC2\s0 13 \*[doc-Tn-font-size]VDISCRD\s0 \*[doc-Tn-font-size]SI\s0 14 \*[doc-Tn-font-size]VWERASE\s0 \*[doc-Tn-font-size]ETB\s0 15 \*[doc-Tn-font-size]VLNEXT\s0 \*[doc-Tn-font-size]SYN\s0 16-19 \fRreserved\fP .TE The .Qq Dv VSTRT is wacky: it's a typo; it's correctly .Dv VSTART in .In sys/termios.h . .Qq Dv VDISCRD is equally wacky and equally just the editor's sticky keyboard. Conversely, the .Dv VSWTCH default is magically correct here. .Pp .Sx Input Modes see the subsumption of all descriptions with their .%B IEEE Std 1003.1-1988 equivalents, if there is one (i.e. not for .Dv IUCLC , .Dv IXANY and additionally not for .Dv IX Ns * ) , though sometimes very poorly copied (as in "If I\*[doc-Tn-font-size]\f(CRNPCK\fP\s0 is not set"), and with "bytes" reverted to "characters", plus the addition of .TS l4zw0 l lfCR l . \*[doc-Tn-font-size]IMAXBEL\s0 Echo \*[doc-Tn-font-size]BEL\s0 on input line too long. .TE described as .Bd -filled -compact -offset 4n If \*[doc-Tn-font-size]\f(CRIMAXBEL\fP\s0 is set, the \*[doc-Tn-font-size]ASCII BEL\s0 character is echoed if the input stream overflows. Further input is not stored, but any input already present in the input stream is not disturbed. If \*[doc-Tn-font-size]\f(CRIMAXBEL\fP\s0 is not set, no \*[doc-Tn-font-size]BEL\s0 character is echoed, and all input present in the input queue is discarded if the input stream overflows. .Ed Which is spelled so obnoxiously as to sound a like standardese, but isn't; .Sy \-imaxbel corresponds to the classic behaviour, and .Sy imaxbel \(en to that of .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 Ns 's .Dv NTTYDISC . .Pp "The initial input control value is \*[doc-Tn-font-size]\f(CRBRKINT, ICRNL, IXON, ISTRIP\fP\s0." .Pp .Sx Output Modes see the addition of .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Seventh Edition Ns -style .Dv XTABS .Dv TAB3 alias. .Pp "The initial output control value is \*[doc-Tn-font-size]\f(CROPOST, ONLCR, TAB3\fP\s0." .Pp The mysterious .Dv RCV1EN .Dv XMT1EN and the all-too-well-described .Dv LOBLK .Sx Control Modes are removed in favour of .TS l4zw0 l lfCR l . \*[doc-Tn-font-size]CIBAUD\s0 Input baud rate, if different from output rate \*[doc-Tn-font-size]PAREXT\s0 Extended parity for mark and space parity .TE .Pp The former is exquisitely-adapted for the specific .%B IEEE Std 1003.1-1988 split-speed interface: .Bd -filled -compact -offset 4n If the \*[doc-Tn-font-size]\f(CRCIBAUD\fP\s0 bits are not zero, they specify the input baud rate, with the \*[doc-Tn-font-size]\f(CRCBAUD\fP\s0 bits specifying the output baud rate; otherwise, the output and input baud rates are both specified by the \*[doc-Tn-font-size]\f(CRCBAUD\fP\s0 bits. The values for the \*[doc-Tn-font-size]\f(CRCIBAUD\fP\s0 bits are the same as the values for the \*[doc-Tn-font-size]\f(CRCBAUD\fP\s0 bits, shifted left \*[doc-Tn-font-size]\f(CRIBSHIFT\fP\s0 bits. .Ed .Pp The latter is undescribed and doesn't appear to be used at all outside the userland. .Pp "The initial hardware control value after open is \*[doc-Tn-font-size]\f(CRB300, CS8, CREAD, HUPCL\fP\s0." .Pp .Sx Local Modes grow .TS l4zw0 l lfCR l . \*[doc-Tn-font-size]TOSTOP\s0 Send \*[doc-Tn-font-size]\f(CRSIGTTOU\fP\s0 for background output. \*[doc-Tn-font-size]ECHOCTL\s0 Echo control characters as ^\fIchar\fP, delete as ^?. \*[doc-Tn-font-size]ECHOPRT\s0 Echo erase character as character erased. \*[doc-Tn-font-size]ECHOKE\s0 BS-SP-BS erase entire line on line kill. \*[doc-Tn-font-size]FLUSHO\s0 Output is being flushed. \*[doc-Tn-font-size]PENDIN\s0 Retype pending input at next read or input character. \*[doc-Tn-font-size]IEXTEN\s0 Enable extended (implementation-defined) functions. .TE .Pp Of these, .Dv FLUSHO is the .Sy discard companion, equally as present-day as .Dv LFLUSHO was in .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 . Likewise for .Oo Dv L Oc Ns Dv TOSTOP , which bears the .%B IEEE Std 1003.1-1988 description. .Pp .Dv ECHOCTL , .Dv ECHOPRT , and .Dv ECHOKE act as present-day re-spellings of .Dv LCTLECH , .Dv LPRTERA , and .Dv LCRTKIL . Similarly for .Oo Dv L Oc Ns Dv PENDIN , which has no present-day equivalent, and which bears in its only kernel-side usage, in .Pa ldterm.c (i.e.\& .Xr ldterm 7 \(em "standard \*[doc-Tn-font-size]STREAMS\s0 terminal line discipline module" \(em .%B UNIX\(rg System V Release 4 System Files and Devices Reference Manual \fIfor\fP Motorola Processors , pp. 159-161): .Bd -literal -compact -offset 4n /* * Yuk. The C shell file completion code actually * uses this "feature", so we have to support it. */ .Ed .Pp .Dv ISIG and .Dv ICANON Ns 's domains grow by the new .Sx Special Control Characters and .Sy eol2 . .Pp .Bd -filled -compact -offset 4n If \*[doc-Tn-font-size]\f(CRIEXTEN\fP\s0 is set, the following implemnetation-defined functions are enabled: special characters (\*[doc-Tn-font-size]\f(CRWERASE, REPRINT, DISCARD\fP\s0, and \*[doc-Tn-font-size]\f(CRLNEXT\fP\s0) and local flags (\*[doc-Tn-font-size]\f(CRTOSTOP, ECHOCTL, ECHOPRT, ECHOKE, FLUSHO\fP\s0, and \*[doc-Tn-font-size]\f(CRPENDIN\fP\s0). .Ed a more rigorous analysis may nickel-and-dime the system on the extension gating, or bring up this from .Pa ldterm.c : .TS center; lfCR . /* \ * EOL2/XCASE should be conditioned with IEXTEN to be truly POSIX conformant.\ \& \ * This is going to cause problems for pre-SVR4.0 programs that don't \ * know about IEXTEN. Hence EOL2/IEXTEN is not conditioned with IEXTEN. \ */ .TE .Pp "The initial line-discipline control value is \*[doc-Tn-font-size]\f(CRISIG, ICANON, ECHO, ECHOK\fP\s0," .Pp .Vt "struct winsize" is explicitly noted now in the .Sx Terminal Size section, alongside its .Dv TIOC Ns Bo Dv GS Bc Ns Dv WINSZ .Fn ioctl Ns s . The .Fn ioctl Ns s taking .Vt "struct termios" , to which .Xr termios 2 decays, all correspond to the .Vt "struct termio" ones but with the final .Dv A substituted for .Dv S , just like .%B X/OPEN Portability Guide (July 1985) fore-told. .\" .Sx Modem Lines skipped and ignored, it affects the hardware and it's literally(?) modem/serial control, sometimes down to the pin. .\" termiox(7) is the same .Pp A consequence of making the teletype interface layered, .Xr ttcompat 7 (ibid., pp. 413-418), described as "\*[doc-Tn-font-size]V7\s0, \*[doc-Tn-font-size]4BSD\s0 and \*[doc-Tn-font-size]XENIX STREAMS\s0 compatibility module" isn't .Em as insane as it sounds; of course, it .Em is insane in just how relatively well it manages to map the entirely different and completely unrelated format of .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 .Vt "struct sgttyb" Ns / Ns Vt "struct ltchars" with sometimes-unmappable modes to something that makes relative sense and provides a sufficient compatibility layer to Just work. .Pp .Xr stty 1 (\c .%B UNIX\(rg System V Release 4 User's Reference Manual , pp. 432-437) escapes accents properly and removes the .Sy swtch Ns / Ns Xr shl 1 Ns / Ns Xr layers 1 paragraph. There are two new sets of modes for controlling the serial/modem hardware .Pq Sx Hardware Flow Control Modes No and Sx Clock Modes , which correspond to .Xr termiox 7 (\c .%B UNIX\(rg System V Release 4 System Files and Devices Reference Manual \fIfor\fP Motorola Processors , pp. 396-400) but are otherwise outside the scope of this document, because most of them biblio down to single pins in EIA-232-D. .Pp "\f(CB0\fP" hangs up "line", rather than "phone line"; "\f(CBhupcl\^(\-hupcl)\fP" loses "Dataphone" and just hangs up "connection". .Pp .TS l1b l1 lb lfCB l lx lzfCB s s lfCB l l lzfCB s s lfCB l l . Input mode Description _ parext\^(\-parext) T{ enable (disable) extended parity generation and detection for mark and space parity. T} ispeed 0 110 300 600 1200 1800 2400 4800 9600 19200 38400 \(<- T{ Set terminal input baud rate to the number given, if possible. (Not all hardware supports split baud rates.) If the input baud rate is set to zero, the input baud rate will be specified by the value of the output baud rate. T} ospeed 0 110 300 600 1200 1800 2400 4800 9600 19200 38400 \(<- T{ Set terminal output baud rate to the number given, if possible. (Not all hardware supports split baud rates.) If the output baud rate is set to zero, the line will be hung up immediately. T} .TE .Pp .Sx Input Modes Ns -wise , "\f(CBixon\^(\-ixon)\fP" sends .Sy start stop rather than hard DC1/DC3. This courtesy is not extended to "\f(CBixany\^(\-ixany)\fP" (in description only; .Sy \-ixany does actually accept the current .Sy start ) . .Pp .TS l1b l1 lb lfCB l lx . Local mode Description _ tostop\^(\-tostop) \(<- T{ send (do not send) SIGTTOU when background processes write to the terminal. T} echoctl\^(\-echoctl) \(<- T{ echo (do not echo) control characters as ^\fIchar\fP, delete as ^? T} echoprt\^(\-echoprt) \(<- T{ echo (do not echo) erase character as character is "erased". T} echoke\^(\-echoke) \(<- T{ BS-SP-BS erase (do not BS-SP-BS erase) entire line on line kill. T} flusho\^(\-flusho) \(<- T{ output is (is not) being flushed T} pendin\^(\-pendin) T{ retype (do not retype) pending input at next read or input character. T} iexten\^(\-iexten) \(<- T{ enable (disable) extended (implementation-defined) functions for input data. T} .TE .Pp "\fIcontrol character c\fP" grows all the new characters, except .Sy min time which are split off, as below. Despite the long index macro, .Dv VREPRINT is .Sy rprnt . .Pp .TS l2b lb lfCB lx . Control assignment Description _ min, time\fI number\fP T{ Set the value of \f(CBmin\fP or \f(CBtime\fP to \fInumber\fP. MIN and TIME are used in Non-Canonical mode input processing (\f(CB\-icanon\fP) T} .TE .Pp .TS l2b lb lfCB lx . Combination mode Description _ spacep enable \f(CBparenb\fP, \f(CBcs7\fP, and \f(CBparext\fP. markp enable \f(CBparenb\fP, \f(CBcs7\fP, \f(CBparodd\fP, and \f(CBparext\fP. \-parity\fR, or \fP\-evenp disable \f(CBparenb\fP, and set \f(CBcs8\fP. \-oddp disable \f(CBparenb\fP and \f(CBparodd\fP, and set \f(CBcs8\fP. \-spacep disable \f(CBparenb\fP and \f(CBparext\fP, and set \f(CBcs8\fP \-markp disable \f(CBparenb\fP, \f(CBparodd\fP, and \f(CBparext\fP, and set \f(CBcs8\fP async T{ set normal asynchronous communications wehre clock settigns are \f(CBxcibrg\fP, \f(CBrcibrg\fP, \f(CBtsetcoff\fP, \f(CBrsetcoff\fP. T} .TE "\f(CB\-parity\fP, or \f(CB\-evenp\fP" retain the old (present-day) semantics, "\f(CB\-oddp\fP" is changed to violate .%B Issue 3 ; this (and spelling .Sy tab3 correctly, and .Tn POSIX Ns -conformant .Sy 0 Ns /hang-up semantics (cf.\& .Sx X/Open CAE Specification, System Interface Definitions Issue 4, Version 2; X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2; X/Open CAE Specification, Commands and Utilities Issue 4, Version 2 ) ) is the only incompatibility. .Pp There's also a new .Sx Window Size section, corresponding directly to .Vt "struct winsize" members, outlined below. "\f(CBrows\fP" is as present-day; "\f(CBcolumns\fP" similarly, but survives as .Sy cols in .\" TODO: .St -p1003.1-202x .Tn \%IEEE No Std 1003.1-202x Pq Dq Tn \%POSIX Ns .1 , Draft 2.1. .Pp .TS l1b l1 lb lfCB l lx . Window size Description _ rows\fI n\fP \(<- set window size to \fIn\fP rows. columns\fI n\fP \(<- set window size to \fIn\fP columns. ypixels\fI n\fP set verical window size to \fIn\fP pixels. xpixels\fI n\fP set horizontal window size to \fIn\fP pixels. .TE .Pp .%B UNIX SYSVr4 Source Code , .Pa ATT-SYSVr4/cmd/ttymon/sttytable.c reveals that "\f(CBspacep\fP" is additionally .Sy \-parodd , and that "\f(CBloblk\^(\-loblk)\fP" is excluded from the .Tn PDP-11 implicitly (by the system not even remotely targeting it), rather than explicitly. .Pp As hinted at, .Sy min time are parsed as decimal integers if they start with a digit (and like normal .Sx Special Control Characters otherwise; ibid., .Pa ATT-SYSVr4/cmd/ttymon/sttyparse.c ) . The .Sx Window Size Ns s are always parsed as decimal integers. .Pp Accepting "\f(CBline\fP \fIi\fP" is predicated on not being attached to a .Xr termio 7 Ns -only .Tn STREAM ; conversely, accepting the new modes is predicated on being attached to a .Xr termios 7 Ns -capable one. .Pp On .Xr termios 7 Ns -capable .Tn STREAMS , if a split speed is set and if the speeds are actually different, they're written as .Qq Li ispeed\ Ns Ar is Ns Li "\ baud;\ ospeed\ " Ns Ar os Ns Li "\ baud;\&" (ibid., .Pa ATT-SYSVr4/cmd/ttymon/stty.c ) . Bare/dual speeds are configured as present-day (input speed zeroed, output speed set). .Pp The default-output .Sy cread sign mismatch bug is fixed; .Qq Sy parenb parext parodd agglomerates to .Qq Sy markp and .Qq Sy parenb parext \-parodd \(en .Qq Sy spacep . .Pp On .Dv TIOC Ns Bo Dv GS Bc Ns Dv WINSZ Ns -capable .Tn STREAMS , the window size is written as .\" "Fa ws_row" style doesn't fit on the page .Bd -literal -compact -offset 4n .Li rows = Sy rows Ns Li "; columns" = Sy cols Ns Li "; ypixels" = Sy ypixels Ns Li "; xpixels" = Sy xpixels Ns Li ;\& .Ed .Pp If .Sy \-icanon , .Sy min time are always written as .Bd -literal -compact -offset 4n .Li min = Sy min Ns Li "; time" = Sy time Ns Li ;\& .Ed .Sy eol2 is listed after after .Sy eol and on .Xr termios 7 Ns -capable .Tn STREAMS , the new characters are written in index order. .Pp All new modes are default-off for purposes of no-argument output. The .Fl g mode is, naturally, longer, since .Dv NCCS > .Dv NCC , but all inputs that don't have the exact field count for the .Xr termios 7 Ns -generated output are trimmed to .Xr termio 7 length. .Pp A .Bx 4.3 Ns -like .Nm is also found in .Pa /usr/ucb . It's been heavily tinkered with, but it retains most, if not all, of its idiosynchracies. . .Ss Standard for Information Technology \(em Portable Operating System Interface (POSIX), Part 2: Shell and Utilities Includes what is essentially .%B Release 3.0 .Xr stty 1 appropriately transduced to the "\*[doc-Tn-font-size]POSIX\s0.1 {8} \fItermios\fP interface" \(em .Rs .%B Standards Project, Draft Standard for Information Technology \(em Portable Operating System Interface (POSIX), Part 2: Shell and Utilities .%C 346 East 47th Street, New York, \\*[doc-Tn-font-size]NY\s0 10017, \\*[doc-Tn-font-size]USA\s0 .%D September 1991 .%N IEEE P1003.2 Draft 11.2 .%N \\*[doc-Tn-font-size]ISO\s0/\\*[doc-Tn-font-size]IEC\s0 \\*[doc-Tn-font-size]CD\s0 9945-2.2 .%N JTC 1.22.21.2 .%O Section 4: Execution Environment Utilities, 4.59 \f(CRstty\fP \(em Set the options for a terminal .%P pp. 613-622 (ll. 12124-12469) .\" http://www.oldlinux.org/Linux.old/Ref-docs/POSIX/all.pdf .%U http://www.oldlinux.org/\:Linux.old/\:Ref-docs/\:POSIX/\:all.pdf .Re .\" https://discord.com/channels/145079846832308224/159324891869347841/1030992689350578347 This is a .Em draft of .%T IEEE Std 1003.2-1992 , naturally, but I was able to confirm with .ie t \{ . . \w'O' .\" ^ this sets rst! .defcolor censgrey grey .2 .gcolor censgrey .fcolor censgrey \Z'\D'P 0 0 3 0 0 -\n[rst]u -3 0''\Z'\D'p 0 0 3 0 0 -\n[rst]u -3 0''\h'3m' .gcolor .fcolor . \} .el ▒▒▒▒▒▒ that no further changes to .Nm occurred before the ratified version; additionally, this is the final draft before the one marked "[\*[doc-Tn-font-size]IEEE\s0 Standard Board Approves??]" (ibid., \fIEditor's Notes\fP, \fI\*[doc-Tn-font-size]POSIX\s0.2 Proposed Schedule\fP, l. 256). .Pp The 4.59.1 Synopsis, (ibid., p. 613 (ll. 12125-12127)) reads .Bd -literal -compact -offset 4n \f(CRstty \fP\fB[ \fP\f(CR-a\fP\fB |\fP\f(CR -g\fP\fB ]\fP \f(CRstty \fP\fIoperands\fP .Ed Without arguments, "it shall report the settings of certain characteristics, usually those that differ from implementation-defined defaults."\& ("an unspecified subset of the infomration written for the \f(CR-a\fP option"), with .Fl a \(en "all the current settings for the terminal", and with .Fl g \(en "all the current settings in an unspecified form that can be used as arguments to another invocation of the \f(CRstty\fP utility on the same system" (ibid., 4.59.2 Description & 4.59.3 Options, pp. 613-614 (ll. 12128-12151)). This is as present-day, except that .Fl g is forbidden from yielding any word expansion at all (which makes pluralisation of the .%B Release 3.0 "used as an argument to" phrasing all the more weird). .Pp The modes are all in the same order and start with the same utilitarian descriptions (but add a reference to the specific macro flag they toggle). These are: .br .%B IEEE P1003.2 Draft 11.2 , 4.59.4 Operands, 4.59.4.1 Control Modes, pp. 614-615 (ll. 12155-12197): all non-speed modes: .Oo \f(CR\-\fP Oc Ns \f(CRparenb\fP , .Oo \f(CR\-\fP Oc Ns \f(CRparodd\fP , .Pf \f(CRcs\fP Ns Bq \f(CR5678\fP (additionally predicated on ", if possible"), .Oo \f(CR\-\fP Oc Ns \f(CRhupcl\fP , .Oo \f(CR\-\fP Oc Ns \f(CRhup\fP , .Oo \f(CR\-\fP Oc Ns \f(CRcread\fP , .Oo \f(CR\-\fP Oc Ns \f(CRclocal\fP ; .br ibid, 4.59.4.2 Input Modes, pp. 615-616 (ll. 12198-12236): all except .Oo \fB\-\fP Oc Ns \fBixany\fP (which "could not be implemented on a \*[doc-Tn-font-size]POSIX\s0.1 {8} system without extensions", but was only noticed after seven drafts \(em ibid., 4.59.10 Rationale., History of Decisions Made, para. 5 (ll. 12457-12458)): .Oo \f(CR\-\fP Oc Ns \f(CRignbrk\fP , .Oo \f(CR\-\fP Oc Ns \f(CRbrkint\fP , .Oo \f(CR\-\fP Oc Ns \f(CRignpar\fP , .Oo \f(CR\-\fP Oc Ns \f(CRparmrk\fP , .Oo \f(CR\-\fP Oc Ns \f(CRinpck\fP , .Oo \f(CR\-\fP Oc Ns \f(CRistrip\fP , .Oo \f(CR\-\fP Oc Ns \f(CRinlcr\fP , .Oo \f(CR\-\fP Oc Ns \f(CRigncr\fP , .Oo \f(CR\-\fP Oc Ns \f(CRicrnl\fP , .Oo \f(CR\-\fP Oc Ns \f(CRixon\fP , .Oo \f(CR\-\fP Oc Ns \f(CRixoff\fP ; .br ibid, 4.59.4.3 Output Modes, p. 616 (ll. 12237-12241): unsurprisingly, just .Oo \f(CR\-\fP Oc Ns \f(CRopost\fP : .Bd -filled -compact -offset 4n Since \*[doc-Tn-font-size]POSIX\s0.1 {8} doesn't specify any output modes, they are not specified in this standard either. Implementations are expected to provide \f(CRstty\fP operands corresponding to all of the output modes they support. .Ed .br ibid, 4.59.4.4 Local Modes, pp. 616-617 (ll. 12242-12278): sans .Oo \fB\-\fP Oc Ns \fBxcase\fP .Pq and Oo \fB\-\fP Oc Ns \fBlfkc\fP : .Oo \f(CR\-\fP Oc Ns \f(CRisig\fP .Pq expanded for Sy susp , .Oo \f(CR\-\fP Oc Ns \f(CRicanon\fP , .Oo \f(CR\-\fP Oc Ns \f(CRecho\fP , .Oo \f(CR\-\fP Oc Ns \f(CRechoe\fP , .Oo \f(CR\-\fP Oc Ns \f(CRechok\fP , .Oo \f(CR\-\fP Oc Ns \f(CRechonl\fP , .Oo \f(CR\-\fP Oc Ns \f(CRnoflsh\fP ; .br ibid, 4.59.4.6 Combination Modes, p. 618 (ll. 12332-12344): \f(CRevenp \fPor\f(CR parity\fP (additionally enforcing the undocumented "disable \f(CRparodd\fP"), \f(CRek\fP ("back to system defaults"), \f(CRsane\fP. .Pp .\" These should be li, then numbers should be unannotated, but .TS lb l lb l1 l1 lx . Control mode Description _ \fInumber\fP \(<- T{ Set terminal baud rate to the number given, if possible. If the baud date is set to zero, the modem control lines shall no longer be asserted. This shall have the effect of setting the input and output \fItermios\fP baud rate values as defined in \*[doc-Tn-font-size]POSIX\s0.1 {8}. T} \f(CRispeed \fP\fInumber\fP \(<- T{ Set terminal input baud rate to the number given, if possible. If the input baud rate is set to zero, the input baud rate shall be specified by the value of the output baud rate. This shall have the effect of setting the input \fItermios\fP baud rate values as defined in \*[doc-Tn-font-size]POSIX\s0.1 {8}. T} \f(CRospeed \fP\fInumber\fP \(<- T{ Set terminal output baud rate to the number given, if possible. If the output baud rate is set to zero, the modem control lines shall no longer be asserted. This shall have the effect of setting the output \fItermios\fP baud rate values as defined in \*[doc-Tn-font-size]POSIX\s0.1 {8}. T} .TE Note the copy-paste error in \f(CRispeed\fP/\f(CRospeed\fP, where "and output"/"input and" was removed, but "values" wasn't depluralised. This remains in all standards hence. .\" TODO: note fixed when fixed, https://www.mail-archive.com/austin-group-l@opengroup.org/msg10224.html .Pp "It is unspecified whether \f(CRstty\fP shall report an error if an attempt to set a Control mode fails."\& (note the absolutely psycho phrasing, which could only result from hasty partial editing), but "Some combinations of operands are mutually exclusive on some terminal types; the results of using such combinations are unspecified.". It's unclear why you'd have both .Em and ibid. 4.59.8 Exit Status, 0, p. 620 (l. 12403) reading "The terminal options were read or set successfully."\& if you explicitly specify that any given combination produces unspecified results? .\" TODO: note https://www.austingroupbugs.net/view.php?id=1508, which fixes the last part but in issue 8 draft 3, in its own section at the end .Pp All as present-day, including lack of any particular mapping from the speeds themselves to any of the macros; cf.\& .Sx STANDARDS , Line Speed . .Pp .TS lb l lb l1fCR l1 lx . Local mode Description _ iexten (\-iexten) \(<- T{ Enable (disable) any implementation-defined special control characters not currently controlled by \f(CRicanon\fP, \f(CRisig\fP, \f(CRixon\fP, or \f(CRixoff\fP. This shall have the effect of setting (not setting) \*[doc-Tn-font-size]IEXTEN\s0 in the \fItermios\fP \fIc_lflag\fP field, as defined in \*[doc-Tn-font-size]POSIX\s0.1 {8}. T} tostop (\-tostop) \(<- T{ Send \*[doc-Tn-font-size]SIGTTOU\s0 for background output. \&…\*[doc-Tn-font-size]TOSTOP\s0… .sp .3v \s-1NOTE: Setting \s0\s-2TOSTOP\s0\s-1 has no effect on systems not supporting the \s0\s-2POSIX\s0\s-1.1 {8} job control option.\s0 T} .TE .Pp .TS lb s lb l1 r1 l . Combination mode Description _ \fIsaved settings\fP \(<- Set the current terminal characteristics to the saved settings produced by the \f(CR-g\fP option. \f(CRnl (\-nl)\fP T{ Enable (disable) \f(CRicrnl\fP. In addition, \f(CR\-nl\fP unsets \f(CRinlcr\fP and \f(CRigncr\fP. T} .TE .Pp .Qq Oo \f(CR\-\fP Oc Ns \f(CRnl\fP is not only defanged to the standard-available modes, but the keen-eyed reader may have noticed that the first sentence is the exact .Em reverse of what they've been historically (and, trivially, .Sy \-nl shouldn't .Em enable carriage-return-to-newline translation). .Pp Naturally, the .Sx Output Attributes Ns -dependent modes .Pq Oo Sy \- Oc Ns Sy lcase Ns / Ns Oo Sy \- Oc Ns Sy LCASE , Oo Sy \- Oc Ns Sy tabs are gone, and equally naturally so are the "\fIterm\fP" ones. Much ink is spilled about "options \f(CRraw\fP and \f(CRcooked\fP (\f(CR\-raw\fP)", .Bd -filled -compact -offset 4n because the exact values that should be set are not well understood or commonly agreed on. In particular, \fItermios\fP has no explicit \*[doc-Tn-font-size]RAW\s0 bit, and the options that should be re-enabled (\f(CR\-raw\fP) are not clear. General programming practice is to save the terminal state, change the settings for the duration of the program, and then reset the state. \&…it is not possible for a single invocation of \f(CRstty\fP to restore the terminal state (\f(CR\-raw\fP) without knowledge of the prior settings. \&…it is impossible to implement this as a single option. .br Also, it is not clear that changing word size and parity is appropriate. For example, requiring that \f(CRcooked\fP set \f(CRcs7\fP and \f(CRparenb\fP would be disastrous for users working with 8\-bit international character sets. In general, these options are to ill-defined to be of any use. .Ed (ibid., 4.69.10, History of Decisions Made, para. 4, pp. 621-622 (ll. 12442-12454)). .Pp Ibid., 4.59.4.5 Special Control Character Assignments, pp. 617-618 (ll. 12279-12231) sees .Sy min time extracted as a common "\f(CRmin\fP \fInumber\fP", "\f(CRtime\fP \fInumber\fP" cell, described identically (\(+-punctuation) to .Sx UNIX\(rg System V Release Ns 's , and the rest now as "\fIcontrol-character\fP\ \fIstring\fP", which is fundamentally mostly unchanged but harbours what is possibly .Em the worst description in the standard: .Bd -filled -compact -offset 4n Set \fIcontrol-character\fP to \fIstring\fP. If \fIcontrol-character\fP is one of the charactter sequences in the first column of Table 4-9, the corresponding \*[doc-Tn-font-size]POSIX\s0.1 {8} control character shall be recognized. This shall have the effect of setting the corresponding element of the \fItermios\fP \fIc_cc\fP array (see \*[doc-Tn-font-size]POSIX\s0.1 {8} 7.1.2). .Ed .sp .TS l4zw0 cb sx s l4zw0 l s s l4zw0 cfBI cb cb l4zw0 l s s l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 cfCR c l l4zw0 l s s . Table 4-9 \(en \f(CBstty\fP Control Character Names \= control-character \*[doc-Tn-font-size]POSIX\s0.1 {8} Subscript Description \_ eof \*[doc-Tn-font-size]VEOF\s0 \*[doc-Tn-font-size]EOF\s0 character eol \*[doc-Tn-font-size]VEOL\s0 \*[doc-Tn-font-size]EOL\s0 character erase \*[doc-Tn-font-size]VERASE\s0 \*[doc-Tn-font-size]ERASE\s0 character intr \*[doc-Tn-font-size]VINTR\s0 \*[doc-Tn-font-size]INTR\s0 character kill \*[doc-Tn-font-size]VKILL\s0 \*[doc-Tn-font-size]KILL\s0 character quit \*[doc-Tn-font-size]VQUIT\s0 \*[doc-Tn-font-size]QUIT\s0 character susp \*[doc-Tn-font-size]VSUSP\s0 \*[doc-Tn-font-size]SUSP\s0 character start \*[doc-Tn-font-size]VSTART\s0 \*[doc-Tn-font-size]START\s0 character stop \*[doc-Tn-font-size]VSTOP\s0 \*[doc-Tn-font-size]STOP\s0 character \_ .TE .sp .Bd -filled -compact -offset 4n If \fIstring\fP is a single characte,r the control character shall be set to that character. If \fIstring\fP is the two-character sequence "\f(CR^-\fP" or the string "\f(CRundef\fP", the control character shall bes set to {_POSIX_VDISABLE}, if it is in effect for the device; if {_POSIX_VDISABLE} is not in effect for this device, it shall be treated as an error. In the \*[doc-Tn-font-size]POSIX\s0 Locale, if \fIstring\fP is a two-character sequence beginning with circumflex (^), and the second character is ont of those listed in the \fI^c\fP column of Table 4-10, the control character shall be set to the corresponding tharacter value in the Value column of the table. .Ed .sp .TS l4zw0 cb s sx s s sx s s l4zw0 l s s s s s s s l4zw0 cfBI cb l cfBI cb l cfBI cb l4zw0 l s s s s s s s l4zw0 cfCR cfCR l cfCR cfCR l cfCR cfCR l4zw0 c s s s s s s s l4zw0 cfCR cfCR l cfCR cfCR l cfCR cfCR l4zw0 l s s s s s s s . Table 4-10 \(en \f(CBstty\fP Circumflex Control Characters \= ^c Value ^c Value ^c Value \_ a\fR,\fP A l\fR,\fP L w\fR,\fP W T{ (this continues for \(fa\-NUL \*[doc-Sy-font]31\fP \*[doc-Xr-font]ascii\fP(7) control characters and their alphabetic 6\s-4\uth\d\s0- and 7\s-4\uth\d\s0-bit extensions plus \f(CR[\e]^_\fP; the only interesting line is reproduced below) T} j\fR,\fP J u\fR,\fP U ? \_ .TE .Pp This is all as present-day, but unhinged, and doesn't stop here. Ibid., 4.59.10, History of Decisions Made, p. 621 para. 2 (ll. 12429-12434), regarding .Dv _POSIX_VDISABLE says: .Bd -filled -compact -offset 4n two convenrions currently exist for specifying this: System V uses "\f(CR^-\fP", and \*[doc-Tn-font-size]BSD\s0 uses \f(CRundef\fP. Both are accepted by \*[doc-Tn-font-size]POSIX\s0.2 \f(CRstty\fP. The other \*[doc-Tn-font-size]BSD\s0 convention of using the letter \f(CRu\fP was rejected because it connflicts with the actual letter \f(CRu\fP, which is an acceptable value for a control character. .Ed One may recall that this is false: the only constraint for a .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 .Nm character argument to become .Sy 0xFF is to .Em start with a .Sq Sy u . .Pp .%B IEEE P1003.2 Draft 11.2 , para. 3 (ll. 12435-12441) confirms that the "traditional mapping" must be specified in full because .Bd -filled -compact -offset 4n although the mapping corresponds to control-character key assignments on many terinals that use \*[doc-Tn-font-size]ISO\s0/\*[doc-Tn-font-size]IEC\s0 646 {1} (or \*[doc-Tn-font-size]ASCII\s0) character encodings, the mapping specified here is to the control characters, not their keyboard encodings. .Ed .Pp The truly revolutionary part here is ibid., 4.59.6 External Effects, 4.59.6.1 Standard Output, pp. 619-620 (ll. 12370-12394), which attempts to arrive at some consensus output format. Of course, this is largely folly, but .Fl a is to write all of \(sc4.59.4 Operands to the standard output stream, and .Bd -filled -compact -offset 4n Unless otherwise specified, this information shall be written as \f(CR\fP-separated tokens in an unspecified format, on one or more lines, with an unspecified number of tokens per line. Additional information may be written. .Ed Which is a good effort, even if all it means is "don't invent random secret pseudo-modes like .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Release 3.0 Ns \&" ; furthermore, .Bd -filled -compact -offset 4n if the terminal input speed and output speed are the same, the speed information shall be written as follows: .br \h'\w'speed i'u'\f(CR"speed %d baud;"\fP, \fI\fP .br Otherwise, speeds shall be written as: .br \h'\w'speed i'u'\f(CR"ispeed %d baud; ospeed %d baud;"\fP, \fI\fP, \fI\fP .Ed with "baud" localisable. "control characters shall be written as:" .Bd -filled -compact -offset 4n \h'\w'speed i'u'\f(CR"%s = %s;"\fP, \fI\fP, \fI\fP .br where \fIvalue\fP is either the character, or some visual representation of the character if it is nonprintable, or the string \f(CR\fP if the character is disabled. .Ed This is all as present-day. .Pp The speeds-equal listing is compatible with .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 and .%B Release 3.0 ; the speeds-different one is saner than all preceding ones. .Pp The .Sx Special Control Characters listing format accomodates .%B Release 3.0 (and none of the .Bx Ns s , due to their inconsistent separators) .Em except that it requires an equal sign before .Qq Li too. .Pp There are obvious parallels to .Sx UNIX\(rg System V Release 4 here, naturally, but the causation is likely converse: drafts were in circulation since the beginning of 1989 (\c .%B IEEE P1003.2 Draft 11.2 , \fI\*[doc-Tn-font-size]POSIX\s0.2 Proposed Schedule\fP, l. 240). The modal additions .Pq Oo Sy \- Oc Ns Sy iexten , Oo Sy \- Oc Ns Sy tostop fall trivially out of the new macros, and their descriptions mirror those in .%B IEEE Std 1003.1-1988 ; the .Bo Sy io Bc Ns Sy speed Ns s , on the other hand, mirror those in .%B IEEE P1003.2 Draft 11.2 and don't follow any previous spelling in .Em any system. Extraction of .Sy min time in the manual (and allowing numbers) mirror the standard, and the new description is identical. Another sign of influence here is that the .Qq Li spelling gains the now-requisite .Sy = ; nevertheless, it is not made conformant: .Sy \-oddp violates both .%B Issue 3 and .%B IEEE P1003.2 Draft 11.2 , and modes are still agglomarated, which violates the latter. .Pp The teletype attached to the standard input stream is used for security .Pq cf. Xr write 1 and redirectability \(em ibid., 4.59.10, History of Decisions Made, para. 7, p. 622 (ll. 12459-12565) \(em in contrast to all non-\c .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Release 3.0 Ns -derived .Nm Ns s . .Pp .Pa /dev/tty is concerned with shell "procedures" rather than "sequences", but otherwise uses the same verbiage all .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Seventh Edition Ns -derived systems do (itself only differing from the .%B Sixth Edition one by a "which" becoming a "that"), additionally predicated on the opening process .Em having a controlling teletype \(em .%B IEEE P1003.2 Draft 11.2 , Section 2: Terminology and General Requirements, 2.7 Required FIles, p. 109 (ll. 3506-3510) \(em but omits the part about feeding it to programs that "demand a file name for output, when typed output is desired and it is tiresome to find out which terminal is currently in use", because it never is. . .\" there /are/ differences between 4.4BSD-Lite1 and 4.4BSD-Lite2 but they're so minute it's like 40 lines total of the parts we're interested in and it's mostly locking .Ss 4.4BSD User's Reference Manual (URM); 4.4BSD Programmer's Reference Manual (PRM) .Bd -filled -compact -offset 4n The biggest area of change is a new terminal driver. The terminal driver is similar to the System V terminal driver with the addition of the necessary extensions to get the functionality previously available in the 4.3BSD terminal driver. 4.4BSD also adds the IEEE Std1003.1 job control interface, which is similar to the 4.3BSD job control interface, but adds a security model that was missing in the 4.3BSD job control implementation. A new system call, \fIsetsid\fP, creates a job-control session consisting ofa single process group with one member, the caller, that becomes a session leader. Only a session leader may acquire a controlling terminal. This is done explicitly via a \*[doc-Tn-font-size]TIOCSCTTY\s0 \fIioctl\fP call, not implicitly by an \fIopen\fP call. The call fails if the terminal is in use. .Ed With emulation for "both the old \fIioctl\fP calls and old options to \fIstty\fP" \(em .Rs .%B 4.4BSD User's Reference Manual (URM) .%D April, 1994 .%N ISBN 1-56592-075-9 .%O Preface, 2. Changes in the Kernel, 2.4. POSIX terminal driver changes .%P \*[doc-Pa-font]usr/src/share/man/man0/title.urm\fP .%Q Computer Systems Research Group, University of California at Berkeley .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_3_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_3_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 3, Final Berkeley Releases, \*[doc-Pa-font]4.4BSD-Lite2\fP .Re .Pp The typical speeds get bumped to .Sy 1200 , 2400 , and .Sy 9600 baud (ibid., Introduction, How to Get Started, \fILogging in\fP, para. 2). .Pp "The ^U (control-U) character", rather than DEL, is the default .Sy kill , and "the delete character (DEL) or sometimes the backspace character (control-H)", rather than just the latter, is the default .Sy erase . .Pp .Sy lnext replaces .Sq Sy \e as the escape for .Sy erase kill , but the wording stays the same (ibid., \fIHow to communicate through your terminal.\fP, para. 2). .Pp If, in .Xr ttys 5 , .Pa console isn't designated .Qq Sy secure , .Xr init 8 itself will prompt for the root passphrase \(em .Rs .%B 4.4BSD Programmer's Reference Manual (PRM) .%D April, 1994 .%N ISBN 1-56592-078-3 .%P \*[doc-Pa-font]usr/src/sbin/init/init.8\fP .%Q Computer Systems Research Group, University of California at Berkeley .\" https://archive.org/details/The_CSRG_Archives_CD-ROM_3_August_1998_Marshall_Kirk_McKusick .%U https://archive.org/\:details/\:The_CSRG_Archives_CD-ROM_3_August_1998_Marshall_Kirk_McKusick .%U Marshall Kirk McKusick, The CSRG Archives, CD-ROM 3, Final Berkeley Releases, \*[doc-Pa-font]4.4BSD-Lite2\fP .Re .Xr tty 4 .Pq ibid., Pa usr/src/share/man/man4/tty.4 becomes a general overview of the teletype subsystem and .Fn ioctl listing; the substantive change is that .Qq The available line disciplines are listed in In sys/termios.h No and currently are:\& .TS l4zw0 lfCR l . TTYDISC Termios interactive line discipline. TABLDISC Tablet line discipline. SLIPDISC Serial IP line discipline. .TE which marks the removal of .Dv OTTYDISC and relabeling, with the aforementioned updates, of .Dv NTTYDISC , and also I hope they recover from the injury. .Pp Of which .Dv TABLDISC is described as .Bd -literal -compact -offset 4n /* * Line discipline for RS232 tablets; * supplies binary coordinate data. */ .Ed (ibid., .Pa usr/src/sys/kern/tty_tb.c , available since .Sx 4.3 Berkeley Software Distribution ) , where "tablet" is used to mean a digitiser/graphics tablet. .Pp "When the .Dv termios line discipline is in effect, the terminal file behaves and is operated according to the rules described in .Xr termios 4 Ns ."\& .Pq ibid., Pa usr/src/share/man/man4/termios.4 \(em "general terminal line discipline" \(em "describes a general terminal line discipline that is supported on tty asynchronous communication ports.". Job control, its edge cases, controlling teletypes, .Dv O_NONBLOCK , .Oo Sy \- Oc Ns Sy icanon processing, base .Sx Special Control Characters , and .Qq Sx Modem Disconnect are .%B IEEE Std 1003.1-1988 verbatim, with choices for implementation-defined behaviour noted, if any. The value of .Dv _POSIX_VDISABLE is not listed, but the former .Sy \-1 recommendation is reused (but spelled as .Sy 0xFF since .Vt cc_t is unsigned; .%B 4.4BSD Programmer's Reference Manual (PRM) , .Pa usr/src/sys/sys/termios.h ) . .Pp .Bd -filled -compact -offset 4n .Brq Dv MAX_CANON is a limit on the number of bytes in a line. The behavior of the system when this limit is exceeded is the same as when the input queue limit .Brq Dv MAX_INPUT , is exceeded. .Ed This appears to match .Sx UNIX\(rg System V Release 4 , but is undocumented there. .Pp "The following special characters are extensions defined by this system and are not a part of 1003.1 termios.". .Sy eol Ns 's verbatim inclusion in the base listing essentially re-spells .Fa t_brkc . .Pp .TS l2fCR lx . EOL2 T{ Secondary \*[doc-Dv-font]EOL\fP character. Same function as \*[doc-Dv-font]EOL\fP. T} WERASE T{ Special character on input and is recognized if the \*[doc-Dv-font]ICANON\fP flag is set. Erases the last word in the current line according to one of two algorithms. If the \*[doc-Dv-font]ALTWERASE\fP flag is not set, first any preceding whitespace is erased, and then the maximal sequence of non-whitespace characters. If \*[doc-Dv-font]ALTWERASE\fP is set, first any preceding whitespace is erased, and then the maximal sequence of alphabetic/underscores or non alphabetic/underscores. As a special case in this second algorithm, the first previous non-whitespace character is skipped in determining whether the preceding word is a sequence of alphabetic/undercores. This sounds confusing but turns out to be quite practical. T} REPRINT T{ Special character on input and is recognized if the \*[doc-Dv-font]ICANON\fP flag is set. Causes the current input edit line to be retyped. T} DSUSP T{ Has similar actions to the \*[doc-Dv-font]SUSP\fP character, except that the \*[doc-Dv-font]SIGTSTP\fP signal is delivered when one of the processes in the foreground process group issues a read() to the controlling terminal. T} LNEXT T{ Special character on input and is recognized if the \*[doc-Dv-font]IEXTEN\fP flag is set. Receipt of this character causes the next character to be taken literally. T} DISCARD T{ Special character on input and is recognized if the \*[doc-Dv-font]IEXTEN\fP flag is set. Receipt of this character toggles the flushing of terminal output. T} STATUS T{ Special character on input and is recognized if the \*[doc-Dv-font]ICANON\fP flag is set. Receipt of this character causes a \*[doc-Dv-font]SIGINFO\fP signal to be sent to the foreground process group of the terminal. Also, if the \*[doc-Dv-font]NOKERNINFO\fP flag is not set, it causes the kernel to write a status message to the terminal that displays the current load average, the name of the command in the foreground, its process ID, the symbolic wait channel, the number of user and system seconds used, the percentage of cpu the process is getting, and the resident set size of the process. T} .TE .Pp Of these, .Sy eol2 is new (presumably for compatibility with .Sx UNIX\(rg System V Release 4 ) , and so is .Sy status (and the rest of the infrastructure it describes). No note is made about automatic .Tn REPRINT on fouling. .Pp "Values of the .Fa c_iflag field describe the basic terminal input control, and are composed of following masks:" .Pp .TS lb lb lfCR l . Input mode Description _ IGNBRK /* ignore BREAK condition */ BRKINT /* map BREAK to SIGINTR */ IGNPAR /* ignore (discard) parity errors */ PARMRK /* mark parity and framing errors */ INPCK /* enable checking of parity errors */ ISTRIP /* strip 8th bit off chars */ INLCR /* map NL into CR */ IGNCR /* ignore CR */ ICRNL /* map CR to NL (ala CRMOD) */ IXON /* enable output flow control */ IXOFF /* enable input flow control */ IXANY /* any char will restart after stop */ IMAXBEL /* ring bell on input queue full */ .TE .Pp It's interesting to note that .Em all of these descrptions are custom, but the order matches .Sx UNIX\(rg System V Release 4 ; besides that, this is the standard set of .%B IEEE Std 1003.1-1988 modes plus .Dv IXANY IMAXBEL , which are described compatibly with .Sx UNIX\(rg System V Release 4 but worse: .Bd -filled -compact -offset 4n If .Dv IXANY is also set, then any character may restart output. .Ed .Bd -filled -compact -offset 4n If .Dv IMAXBEL is set and the input queue is full, subsequent input shall cause an .Tn ASCII .Dv BEL character to be transmitted to the the output queue. .Ed (it's also described earlier to actually be the same). .Pp .Dv IXOFF corresponds to the .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 .Dv TANDEM mode, .Dv ICRNL to the input half of .Dv CRMOD , and .Dv ISTRIP is the inverse of .Dv LPASS8 ; .Dv IXANY is the inverse of .Sx 4.1 Berkeley distribution .Dv LDECCTQ . .Pp The other descriptions are verbatim the .Tn POSIX ones, sans changing the tense from "shall" to "does". This extends to the default value and .Sy ixoff conditions, which are also listed as "implementation defined" (note the loss of punctuation). .Pp "Values of the .Fa c_oflag field describe the basic terminal output control, and are composed of the following masks:" .Pp .TS l1b l1 lb lfCR l l . Output mode Description _ OPOST \(<- /* enable following output processing */ ONLCR \(<- /* map NL to CR-NL (ala CRMOD) */ OXTABS \(lA /* expand tabs to spaces */ ONOEOT /* discard EOT's '^D' on output) */ .TE .Pp .Dv OPOST is the inverse of the former .Dv LLITOUT , .Dv ONLCR helpfully points out it's the output half of .Dv CRMOD . and .Dv OXTABS \(en to .Dv XTABS , though on modern-day .Bx 4.4 derivatives this, if at all, survives as .Dv TAB3 (even if it's the only .Pf non- Dv TAB0 delay mode) instead. .\" FreeBSD .Dv ONOEOT was the default in cooked mode. .Pp No note is made of the default value. .Pp "Values of the .Fa c_cflag field describe the basic terminal hardware control, and are composed of the following masks." .Pp .TS lb lb lfCR l . Control mode Description _ CSIZE /* character size mask */ CS5 /* 5 bits (pseudo) */ CS6 /* 6 bits */ CS7 /* 7 bits */ CS8 /* 8 bits */ CSTOPB /* send 2 stop bits */ CREAD /* enable receiver */ PARENB /* parity enable */ PARODD /* odd parity, else even */ HUPCL /* hang up on last close */ CLOCAL /* ignore modem status lines */ CCTS_OFLOW /* CTS flow control of output */ CRTSCTS /* same as CCTS_OFLOW */ CRTS_IFLOW /* RTS flow control of input */ MDMBUF /* flow control output via Carrier */ .TE .Pp Same applies to the labeling, order, and descriptions (though the lack of indentation for .Dv CS Ns * yields another sentence on them being masked by .Dv CSIZE ) , and .Dv CREAD is opined on with the appendage of .Bd -filled -compact -offset 4n Not all hardware supports this bit. In fact, this flag is pretty silly and if it were not part of the .Nm termios specification it would be omitted. .Ed .Pp It's unclear why .Dv CS5 is marked "pseudo"; it appears to be supported on the devices that do and not on those that don't. .Pp .Dv CRTS_IFLOW is not additionally described, but Clear to send and Request to send are part of RS232 hardware flow control. .Bd -filled -compact -offset 4n The .Dv CCTS_OFLOW .Pq Dv CRTSCTS flag is currently unused. .Ed But does actually appear to be used on some platforms (like .%B 4.4BSD Programmer's Reference Manual (PRM) , .Pa usr/src/sys/sparc/dev/zs.c ) . .Pp .Dv MDMBUF ("output flow control is controlled by the state of Carrier Detect.") corresponds to the .Dv LMDMBUF ("Stop/start output when carrier drops") .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 mode. .Pp No note is made of the default value. .Pp "Values of the .Fa c_lflag field describe the control of various functions, and are composed of the following masks." .Pp .TS l1b l1 lb lfCR l l . Local mode Description _ ECHOKE /* visual erase for line kill */ ECHOE \(<- /* visually erase chars */ ECHO \(<- /* enable echoing */ ECHONL \(<- /* echo NL even if ECHO is off */ ECHOPRT \(<- /* visual erase mode for hardcopy */ ECHOCTL \(<- /* echo control chars as ^(Char) */ ISIG \(<- /* enable signals INTR, QUIT, [D]SUSP */ ICANON \(<- /* canonicalize input lines */ ALTWERASE \(<- /* use alternate WERASE algorithm */ IEXTEN \(<- /* enable DISCARD and LNEXT */ EXTPROC \(<- /* external processing */ TOSTOP \(<- /* stop background jobs from output */ FLUSHO \(<- /* output being flushed (state) */ NOKERNINFO /* no kernel output from VSTATUS */ PENDIN /* XXX retype pending input (state) */ NOFLSH \(<- /* don't flush after interrupt */ .TE .Pp Same applies to the labeling (which is extra psycho here) and descriptions (down to "an implementation may echo an indication that" no erasing was needed for .Sy icanon echoe , and .Dv NOFLSH flushing "are not be done", which is "shall not be done" in the standard). The observant reader may notice that .Dv ECHOK is missing, but this just seems to be a documentation error, and it's in .Pa termios.h , commented .Qq Li "/* echo NL after line kill */" , also as present-day. .Pp .Dv ECHOKE does indeed seem to replace/override .Dv ECHOK , rather than being a mode flag for it like in .Sx UNIX\(rg System V Release 4 and explicitly doesn't work with .Dv ECHOPRT (in which case it behaves like .Dv ECHOK ; ibid., .Pa usr/src/sys/kern/tty.c , .Fn ttyinput ) . This is odd, and in contrast with .Dv LPRTERA (and .Sx UNIX\(rg System V Release 4 ) . .Pp .Dv ECHOE , .Dv ECHOCTL , .Dv FLUSHO , .Dv PENDIN , and .Dv NOFLSH correspond to .Dv LCRTERA , .Dv LCTLECH , .Dv LFLUSHO , .Dv LPENDIN , and .Dv LNOFLSH , and match .Sx UNIX\(rg System V Release 4 . It's unclear why .Dv PENDIN is "XXX"ed, it appears fully-functional .Pq ibid., Fn ttypend , Fn ttread . .Pp .Dv ALTWERASE , .Dv NOKERNINFO , and .Dv EXTPROC are new and defer to previous sections, except for the latter, which is undescribed. It appears to short-circuit appx. all line editing, echoing, prevent .Dv OXTABS .Pq ibid., Fn ttyinput , Fn ttyrub , Fn ttyecho , Fn ttyoutput and forward .Fn ioctl Ns s in .Xr pty 4 .Pq ibid., Pa usr/src/share/man/man4/pty.4 packet mode to the remote (ibid., .Pa usr/src/sys/kern/tty_pty.c , .Fn ptyioctl ) . .Pp The macro is actually as old as .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 , described as .Qq Li "/* external processor (kmc) */" (\c .Pa usr/include/sys/tty.h ) , but unused until now. .Pp No note is made of the default value. .Pp Initial .Sx Special Control Characters values are "set according to the values in the header .In sys/ttydefaults.h Ns \&."\& (of course, one is also directed to the nonexistent .In ttydefaults.h a few lines away instead). The entirely unsurprising summary from the manual follows; it's in declaration order, and doesn't match any other layout, not that it really ought to. .Pp .ie n .ds QlVS ' .el .ds QlVS \f(CR .ie n .ds QlVE ' .el .ds QlVE \fP .TS l4 l4 l l l l lfCR l l . Index Name Special Character Default Value \_ \_ \_ VEOF EOF ^D VEOL EOL _POSIX_VDISABLE VEOL2 EOL2 _POSIX_VDISABLE VERASE ERASE ^? \*[QlVS]\e177\*[QlVE] VWERASE WERASE ^W VKILL KILL ^U VREPRINT REPRINT ^R VINTR INTR ^C VQUIT QUIT ^\e\e \*[QlVS]\e34\*[QlVE] VSUSP SUSP ^Z VDSUSP DSUSP ^Y VSTART START ^Q VSTOP STOP ^S VLNEXT LNEXT ^V VDISCARD DISCARD ^O VMIN --- 1 VTIME --- 0 VSTATUS STATUS ^T .TE .Pp Notably: all (actual) delay modes and .Dv LCASE are lost, and thank god. This distribution supports close to a dozen platforms and post-dates the relative ubiquity of display terminals by close to two decades. .Pp .Dv LTILDE is lost, presumably because the last .Tn Hazeltine Ns -branded product that used .Sy ~ Ns s as escape introducers and didn't allow using ESCs was the .Tn 1500 , released in 1977 \(em .Rs .%B Hazeltine 1500 Series Video Display Terminals Maintenance Manual .%C Greenlawn, N.Y. 11740 .%D December 1977 .%N HI-1053A .%O 1. Introduction and Description, 1.2 General Description, 1.2.1 Model 1500 and 1.2.2 Model 1510 .%P pp. 1-1, 1-8 .%Q Hazeltine Corporation Computer Terminal Equipment .\" http://bitsavers.org/pdf/hazeltine/H1500/Hazeltine_1500_Series_Maintenance_Manual_Dec77.pdf .%U http://bitsavers.org/\:pdf/\:hazeltine/\:H1500/\:Hazeltine_1500_Series_Maintenance_Manual_Dec77.pdf .Re .Pp So is .Dv LETXACK but that's because it was never actually implemented. .Pp .Dv LCRTBS is superseded by faster video terminals not needing it (so also by .Dv ECHOE ) . .Pp "RAW" mode survives as one of the .Sx Combos , and maps very well. "CBREAK" mode is much iffier .Pq Sy \-icanon No excludes Sy lnext , and is unrepresentable per se. .Pp Rather than being encoded in some flag, .Vt "struct termios" has .Fa c_ Ns Bo Fa io Bc Ns Fa speed .Vt speed_t members (although .Vt speed_t is a .Vt long so it's non-conformant), and the standard .Nm cf Ns Bo Nm gs Bc Ns Nm et Ns Bo Nm io Bc Ns Fn speed functions set/return that (\c .%B 4.4BSD Programmer's Reference Manual (PRM) , .Pa usr/src/lib/libc/gen/tcsetattr.3 ) . A .Fn cfsetspeed extenion is also provided, expectedly just writing to both, and a .Fn cfmakeraw that "sets the flags stored in the termios structure to a state disabling all input and output processing, giving a \(Fcraw I/O path.\(Fo" (\c .Sy \-ignbrk \-brkint \-parmrk \-istrip \-inlcr \-igncr \-icrnl \-ixon \-opost cs8 \-parenb \-isig \-icanon \-echo \-echonl \-iexten but .Qq Li "/* XXX set MIN/TIME */" ; ibid., .Pa usr/src/lib/libc/gen/termios.c ) . The remainder of the interface is uneventful; the speed effects defer to .Xr termios 4 and the rest copies .%B IEEE Std 1003.1-1988 \(sc7.2.1. .Pp However, this is the first system the breaks away from the enshrined .Tn DH11 Line Parameter Register enumeration value, and "The value of the integer corresponds directly to the baud rate being represented" (with 134.5 baud truncated to .Sy 134 ) ; compatibility macros are defined (the usual .Dv EXTA .Dv EXTB for .Sy 19200 .Sy 38400 ) , but a speed finally is Just an integer, and many more pre-defined macros are provided .Pq Sy 7200 , 14400 , 28800 , 57600 , 76800 , 115200 , 230400 No baud , presumably for means-testing. .Pp .Bd -filled -compact -offset 4n We have been tracking the IEEE Std1003.2 shell and utility work and have included prototypes of many of the proposed utilities. Most of the traditional utilities have been replaced with implementations conformant to the POSIX standards. Almost the entire manual suite has been rewritten to reflect the POSIX defined interfaces. .Ed (\c .%B 4.4BSD User's Reference Manual (URM) , Preface, 3. Changes to the utilities); "rewritten" is very generous \(em .%B IEEE P1003.2 Draft 11.2 \(sc4.59.4 Operands is copied entirely (sans the explicit flag macro name sentences and "shall" retensed to "does"), and the .Sx DESCRIPTION likewise calques \(sc4.59.2 Description. The new .Sx SYNOPSIS is: .Bd -filled -compact -offset 4n .Nm .Op Fl a | e | g .Op Fl f Ar file .Op operands .Ed with an option listing of .\" fucked up quotes around "POSIX" normalised .TS l4zw0 l2 lx . \*[doc-Cm-font]-a\fP T{ Display all the current settings for the terminal to standard output as per \*[doc-Tn-font-size]IEEE Std\s01003.2 ("\*[doc-Tn-font-size]POSIX\s0"). T} \*[doc-Cm-font]-e\fP T{ Display all the current settings for the terminal to standard output in the traditional \*[doc-Tn-font-size]BSD\s0 "all" and "everything" formats. T} \*[doc-Cm-font]-f\fP T{ Open and use the terminal named by \*[doc-Ar-font]file\fP rather than using standard input. The file is opened using the \*[doc-Dv-font]O_NONBLOCK\fP flag of \*[doc-Fn-font]open\fP(), making it possible to set or display settings on a terminal that might otherwise block on the open. T} \*[doc-Cm-font]-g\fP T{ Display all the current settings for the terminal to standard output in a form that may be used as an argument to a subsequent invocation of \*[doc-Nm-font]stty\fP to restore the current terminal state as per \*[doc-Tn-font-size]IEEE Std\s01003.2 ("\*[doc-Tn-font-size]POSIX\s0"). T} .TE .Pp Additional flags matching the .Xr termio 4 extensions follow. .Pp .TS l1b l1 lbx l c l lb c lb l c l l c l lb c lb l c l l c l lb c lb l c l l c l l c l l s l l c l l c l l c l lb c lb l c l . Control mode Description _ \*[doc-Cm-font]crtscts\fP (\*[doc-Cm-font]\-crtscts\fP) \(<- Enable RTS/CTS flow control. = Input mode Description _ \*[doc-Cm-font]ixany\fP (\*[doc-Cm-font]\-ixany\fP) \(<- Allow any character (allow only \*[doc-Dv-font]START\fP) to restart output. \*[doc-Cm-font]imaxbel\fP (\*[doc-Cm-font]\-imaxbel\fP) \(<- T{ The system imposes a limit of \*[doc-Dv-font]MAX_INPUT\fP (currently 255) characters in the input queue. If \*[doc-Cm-font]imaxbel\fP is set and the input queue limit has been reached, subsequent input causes the system to send an ASCII BEL character to the output queue (the terminal beeps at you). Otherwise, if \*[doc-Cm-font]imaxbel\fP is unset and the input queue is full, the next input character causes the entire input and output queues to be discarded. T} = Output mode Description _ \*[doc-Cm-font]onlcr\fP (\*[doc-Cm-font]\-onlcr\fP) \(<- Map (do not map) \*[doc-Dv-font]NL\fP to \*[doc-Dv-font]CR-NL\fP on output. \*[doc-Cm-font]oxtabs\fP (\*[doc-Cm-font]\-oxtabs\fP) Expand (do not expand) tabs to spaces on output. = Local mode Description _ \*[doc-Cm-font]echoke\fP (\*[doc-Cm-font]\-echoke\fP) \(<- T{ The \*[doc-Dv-font]KILL\fP character shall (shall not) visually erase the the current line from the display, if possible. T} \*[doc-Cm-font]echoctl\fP (\*[doc-Cm-font]\-echoctl\fP) \(<- T{ If \*[doc-Cm-font]echoctl\fP is set, echo control characters as ^X. Otherwise control characters echo as themselves. T} \*[doc-Cm-font]echoprt\fP (\*[doc-Cm-font]\-echoprt\fP) \(<- T{ For printing terminals. If set, echo erased characters backwards within "\e" and "/". Otherwise, disable this feature. T} \*[doc-Cm-font]altwerase\fP (\*[doc-Cm-font]\-altwerase\fP) T{ Use (do not use) an alternate word erase algorithm when processing \*[doc-Dv-font]WERASE\fP characters. This alternate algorithm considers sequences of alphanumeric/underscores as words. It also skips the first preceding character in its classification (as a convenience since the one preceding character could have been erased with simply an \*[doc-Dv-font]ERASE\fP character.) T} \*[doc-Cm-font]mdmbuf\fP (\*[doc-Cm-font]\-mdmbuf\fP) T{ If set, flow control output based on condition of Carrier Detect. Otherwise writes return an error if Carrier Detect is low (and Carrier is not being ignored with the \*[doc-Dv-font]CLOCAL\fP flag.) T} \*[doc-Cm-font]flusho\fP (\*[doc-Cm-font]\-flusho\fP) \(<- Indicates output is (is not) being discarded. \*[doc-Cm-font]pendin\fP (\*[doc-Cm-font]\-pendin\fP) T{ Indicates input is (is not) pending after a switch from non-canonical to canonical mode and will be re-input when a read becomes pending or more input arrives. T} = Combination mode Description _ \*[doc-Cm-font]kerninfo\fP (\*[doc-Cm-font]\-kerninfo\fP) T{ Enable (disable) the system generated status line associated with processing a \*[doc-Dv-font]STATUS\fP character (usually set to ^T). The status line consists of the system load average, the current command name, its process ID, the event the process is waiting on (or the status of the process), the user and system times, percent cpu, and current memory usage. T} \*[doc-Cm-font]extproc\fP (\*[doc-Cm-font]\-extproc\fP) \(<- T{ If set, this flag indicates that some amount of terminal processing is being performed by either the terminal hardware or by the remote side connected to a pty. T} .TE (Note that the .Oo Cm \- Oc Ns Cm onlcr description uses a mis-spelled macro to mark up .Qq Dv CR-NL and hence reads "to on output"; only the wording for .Oo Cm \- Oc Ns Cm echoprt and .Oo Cm \- Oc Ns Cm pendin is thinly ported, all other descriptions are (re-)written; .Oo Cm \- Oc Ns Cm kerninfo doesn't combine anything, since it correspond directly to (the inverse of) .Dv NOKERNINFO ; the same holds for .Oo Cm \- Oc Ns Cm extproc .Pq Dv EXTPROC , but that's implemented with .Nm ioctl Ns Pq Dv TIOCEXT , which sends an appropriate packet and then (un)sets the flag (\c .Pa tty_pty.c , .Fn ptyioctl ; .Dv EXTPROC is unchangeable via .Fn tcsetattr \(em ibid., .Pa usr/src/sys/kern/tty.c , .Fn ttioctl Ns ").)" .Pp The description for .Oo Cm \- Oc Ns Cm ixon is made aware of .Cm ixany with ", or if .Cm ixany is set, any character restarts output."; for .Oo Cm \- Oc Ns Cm ixoff \(en respelled as "Request that the system send (not send) \*[doc-Dv-font]START/STOP\fP characters when the input queue is nearly empty/full." for unclear reasons. .Pp The world's worst table is appropriately expanded to cover the extended .Sx Special Control Characters , but see below. .Pp .Cm size , .Cm columns Ns \& Ar number , .Cm cols Ns \& Ar number , and .Cm rows Ns \& Ar number are all retained as .Sx Combination Modes Ns "(?)." So is .Qq Cm dec , but the modes turn into "\*[doc-Dv-font]ixany\fP is disabled, and \*[doc-Dv-font]crt\fP is enabled", and .Qq Oo Cm \- Oc Ns Cm crt , but the description becomes a useless "Set (disable) all modes suitable for a CRT display device." (\c .%B 4.4BSD User's Reference Manual (URM) , .Pa usr/src/bin/stty/modes.c says it's .Qo Sy echoe \-echok echoke echoctl \-echoprt Qc Ns / Ns Qq Sy \-echoe echok \-echoke \-echoctl , which is compatible, but assumes a .Pf \(>= Sy 1200 Ns -baud connection). .Cm sane is spelled as "Resets all modes to reasonable values for interactive terminal use.". .Pp A .Qq Cm speed Ar number "mode" is noted after the other speed-setting ones as .Qq This sets both Cm ispeed Ns " and" Cm ospeed Ns " to" Ar number Ns .\& , but instead this is a misdocumented retainment of the .Sy speed query (which continues to report just the output speed, but now just as the integer value w/o lookup). .Pp A .Qq Cm tty pseudo-combination-mode is added to "Set the line discipline to the standard terminal line discipline \*[doc-Dv-font]TTYDISC\fP.", mirroring the former .Qo Sy new Qc Ns / Ns Qq Sy old . .Pp .Qq Oo Cm \- Oc Ns Cm raw becomes .Bd -filled -compact -offset 4n If set, change the modes of the terminal so that no input or output processing is performed. If unset, change the modes of the terminal to some reasonable state that performs input and output processing. .Ed followed by, essentially, a re-telling of the .%B IEEE P1003.2 Draft 11.2 , 4.59.10, History of Decisions Made, para. 4 (ll. 12442-12454) litany, but gets it wrong and proclaims that the "recommended" way to restore the mode is with .Qq Li stty \&"$save_state" , which isn't forward-compatible and goes .Em against the recommendation/example in ibid., 4.59.10, Examples, Usage, para. 2 (ll. 12412-12422), which does .Em not quote the .Nm Fl g output. .br .Qq Cm cooked , rather than being .Qq Sy \-raw , becomes .Qq Sy sane . This is because so does .Sy \-raw , but you wouldn't know it (\c .%B 4.4BSD User's Reference Manual (URM) , .Pa usr/src/bin/stty/key.c , .Fn f_raw ) . .Pp .Sx Compatibility Modes , which "remain for compatibility with the previous version of the stty command" are tabulated below. .Pp .TS l1b l1 lb l l lx . Mode Description _ \*[doc-Cm-font]all\fP T{ Reports all the terminal modes as with \*[doc-Nm-font]stty\fP \*[doc-Cm-font]-a\fP except that the control characters are printed in a columnar format. T} \*[doc-Cm-font]everything\fP Same as \*[doc-Cm-font]all\fP. \*[doc-Cm-font]cooked\fP Same as \*[doc-Cm-font]sane\fP. \*[doc-Cm-font]cbreak\fP T{ If set, enables \*[doc-Cm-font]brkint\fP, \*[doc-Cm-font]ixon\fP, \*[doc-Cm-font]imaxbel\fP, \*[doc-Cm-font]opost\fP, \*[doc-Cm-font]isig\fP, \*[doc-Cm-font]iexten\fP, and \*[doc-Cm-font]\-icanon\fP. If unset, same as \*[doc-Cm-font]sane\fP. T} \*[doc-Cm-font]new\fP Same as \*[doc-Cm-font]tty\fP. \*[doc-Cm-font]old\fP Same as \*[doc-Cm-font]tty\fP. \*[doc-Cm-font]newcrt\fP (\*[doc-Cm-font]\-newcrt\fP) Same as \*[doc-Cm-font]crt\fP. \*[doc-Cm-font]pass8\fP The converse of \*[doc-Cm-font]parity\fP. \*[doc-Cm-font]tandem\fP (\*[doc-Cm-font]\-tandem\fP) \(<- Same as \*[doc-Cm-font]ixoff\fP. \*[doc-Cm-font]decctlq\fP (\*[doc-Cm-font]\-decctlq\fP) \(<- The converse of \*[doc-Cm-font]ixany\fP. \*[doc-Cm-font]crterase\fP (\*[doc-Cm-font]\-crterase\fP) \(<- Same as \*[doc-Cm-font]echoe\fP. \*[doc-Cm-font]crtbs\fP (\*[doc-Cm-font]\-crtbs\fP) Same as \*[doc-Cm-font]echoe\fP. \*[doc-Cm-font]crtkill\fP (\*[doc-Cm-font]\-crtkill\fP) Same as \*[doc-Cm-font]echoke\fP. \*[doc-Cm-font]ctlecho\fP (\*[doc-Cm-font]\-ctlecho\fP) \(<- Same as \*[doc-Cm-font]echoctl\fP. \*[doc-Cm-font]prterase\fP (\*[doc-Cm-font]\-prterase\fP) \(<- Same as \*[doc-Cm-font]echoprt\fP. \*[doc-Cm-font]litout\fP (\*[doc-Cm-font]\-litout\fP) The converse of \*[doc-Cm-font]opost\fP. \*[doc-Cm-font]tabs\fP (\*[doc-Cm-font]\-tabs\fP) The converse of \*[doc-Cm-font]tabs\fP. \*[doc-Cm-font]brk \fP\*[doc-Ar-font]value\fP Same as the control character \*[doc-Cm-font]eol\fP. \*[doc-Cm-font]flush \fP\*[doc-Ar-font]value\fP Same as the control character \*[doc-Cm-font]discard\fP. \*[doc-Cm-font]rprnt \fP\*[doc-Ar-font]value\fP \(<- Same as the control character \*[doc-Cm-font]reprint\fP. .TE .Pp This is ontologically problematic: how can .Qq Oo Cm \- Oc Ns Cm tabs be the converse of .Qq Cm tabs ? If .Oo Cm \- Oc Ns Cm crterase \(== .Oo Cm \- Oc Ns Cm echoke \(== .Qq Oo Cm \- Oc Ns Cm crtbs how is .Oo Cm \- Oc Ns Cm crterase \(ne .Qq Oo Cm \- Oc Ns Cm crtbs ? .Pp We are, helpfully, treated to some dialectics in .Pa modes.c : .Bd -literal -compact -offset 4n { "tabs", 0, OXTABS }, /* "preserve" tabs */ { "-tabs", OXTABS, 0 }, .Ed and .Bd -literal -compact -offset 4n { "crtbs", ECHOE, 0 }, /* crtbs not supported, close enough */ { "-crtbs", 0, ECHOE }, .Ed through which we find that .Qq Oo Cm \- Oc Ns Cm tabs is actually equivalent to the "converse" of .Qq Oo Cm \- Oc Ns Cm oxtabs , which is equivalent to .Sy tab Ns Bq Sy 03 , which is as present-day; and that the latter is a solid approximation tending toward upgrade. .Pp .\" There's a big paragraph that's really weird about "Local Modes" and what local means. Untestable. Out of scope. Don't care. The observant reader may note that .Dv NOKERNINFO appears only as its inverse, which is odd, and .Dv ONOEOT doesn't appear at all. A truly pendantic reader may note that to exhaust all .\" documented .\" (so not .\" .Dv CIGNORE , .\" which is how .\" .Dv TCSASOFT .\" is mediated) .Xr termios 4 flags, .Dv CRTS_IFLOW would also need to be added. Indeed, they are both missing, but .Qq Oo Sy \- Oc Ns Sy nokerninfo is one of the secret modes, below. .Pp .TS l1b l1 l2b lfBI lb l l l . Secret mode Equiv. Huh? _ \-pass8 \*[doc-Cm-font]parity\fP As-expected \fR[\fP\-\fR]\fPnokerninfo \(no[\*[doc-Cm-font]\-\fP]\*[doc-Cm-font]kerninfo\fP \^ discard \*[doc-Ar-font]cc\fP \(<- \*[doc-Cm-font]flush \fP\*[doc-Ar-font]value\fP Not mentioned in The Table, only implied in \*[doc-Cm-font]flush\fP \fR[\fP\-\fR]\fPflow [\*[doc-Cm-font]\-\fP]\*[doc-Cm-font]ixon\fP No precedent \*[doc-Ar-font]char\fP \*[doc-Li-font]\fP \*[doc-Ar-font]char\fP \*[doc-Li-font]undef\fP Where \*[doc-Ar-font]char\fP is any \*[doc-Sx-font]Special Control Character\fP (incl. \fBmin time\fP) .TE .Pp There's also a disinformation mode: .Sy ek doesn't exist despite the mandate and documentation. .Pp It wouldn't be a .Nm if the documentation, where it described existing modes, wasn't lying, or actually said what they did (\c .Pa key.c ; final ibid., .Pa usr/src/bin/stty/cchar.c , then .Pa usr/src/bin/stty/stty.c ) . .Pp .TS l2b l2b lfBI l nb lx . Mode Problem Huh? _ \*[doc-Cm-font]nl\fP \fRIs \fP\&\-icrnl \-onlcr T{ Exact opposite of what they should be; [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]onlcr\fP undocumented; \*[doc-Sy-font]\-inlcr \-igncr\fP missing for \*[doc-Cm-font]\-nl\fP T} \h'\w'\*[doc-Cm-font]nl\fP'u' (\*[doc-Cm-font]\-nl\fP) \fRIs \fP\&icrnl onlcr \^ \*[doc-Cm-font]\-parity\fP, \*[doc-Cm-font]\-evenp\fP, \*[doc-Cm-font]\-oddp\fP \fRAlso \fP\&\-parodd \*[doc-Cm-font]dec\fP \fRDoesn't \fP\&\-echok \*[doc-Cm-font]crt\fP does .TE .sp .TS l2b lb l lx . Mode Is _ \*[doc-Cm-font]raw\fP \*[doc-Nm-font]cfmakeraw\fP(), \*[doc-Sy-font]cs8 \-parenb\fP \*[doc-Cm-font]sane\fP T{ \*[doc-Fa-font]c_iflag\fP set to \*[doc-Sy-font]brkint istrip icrnl ixon ixany imaxbel\fP .br \*[doc-Fa-font]c_oflag\fP set to \*[doc-Cm-font]oxtabs\fP \*[doc-Sy-font]opost onlcr\fP .br \*[doc-Fa-font]c_cflag\fP set to \*[doc-Sy-font]cs7 cread parenb hupcl\fP with existing state of [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]clocal\fP retained .br \*[doc-Fa-font]c_lflag\fP set to \*[doc-Sy-font]isig icanon echo echoe echoke echoctl iexten\fP with existing state of [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoe\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echok\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoke\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]noflsh\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]tostop\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoctl\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]echoprt\fP [\*[doc-Sy-font]\-\fP]\*[doc-Sy-font]altwerase\fP retained T} \*[doc-Cm-font]min \fP\*[doc-Ar-font]number\fP T{ Decimal \*[doc-Ar-font]number\fPs, max. of \*[doc-Dv-font]UCHAR_MAX\fP (\*[doc-Sy-font]0xFF\fP) and rejected if parses to same as \*[doc-Dv-font]_POSIX_VDISABLE\fP. T} \*[doc-Cm-font]time \fP\*[doc-Ar-font]number\fP \^ \*[doc-Ar-font]number\fP T{ All take otherwise-unchecked decimal \*[doc-Ar-font]number\fPs. .br The bare-\*[doc-Ar-font]number\fP form explicitly sets both speeds. T} \*[doc-Cm-font]ispeed \fP\*[doc-Ar-font]number\fP \^ \*[doc-Cm-font]ospeed \fP\*[doc-Ar-font]number\fP \^ .TE .Pp Note, that, per .%B IEEE P1003.2 Draft 11.2 \(sc7.1.2.6 para. 6 (p. 134): .Bd -filled -compact -offset 4n If \*[doc-Tn-font-size]ICANON\s0 is not set, the value of \*[doc-Tn-font-size]{_POSIX_VDISABLE}\s0 has no special meaning for the \*[doc-Tn-font-size]VMIN\s0 and \*[doc-Tn-font-size]VTIME\s0 entries of the \fIc_cc\fP array. .Ed so accepting .Qq Oo Li < Oc Ns Li undef Ns Oo Li > Oc and rejecting .Ar number = .Dv _POSIX_VDISABLE is definitely suspicious. Funnily enough, this appears to have absolutely no bearing on the system, since there are precisely zero mentions of .Dv VMIN Ns / Ns Dv VTIME in kernel code, except for a "SYS5 style termio" mapping in the .Li hpuxcompat module (\c .%B 4.4BSD Programmer's Reference Manual (PRM) , .Pa usr/src/sys/hp/hpux/hpux_tty.c , .Fn hpuxtermio ) , which says .Bd -literal -compact -offset 4n * XXX since VMIN and VTIME are not implemented, * we need to return something reasonable. .Ed and, indeed, .Sy \-icanon appears to be always in hard-\c .Sy min Ar 1 .Sy time Ar 0 mode(?) \(em .Pa tty.c , .Fn ttread . .Pp Despite the purported emulation, there is a marked loss of functionality against .%B UNIX User's Reference Manual (URM), 4.3 Berkeley Software Distribution, Virtual VAX\-11 Version that doesn't correspond to removed unemulatable modes, below. .Pp .TS l2b lfBI lb lx . Lost Really? _ exta extb T{ No explicit provision; \*[doc-Sy-font]134.5\fP gets by by the skin of its teeth because it gets truncated by \*[doc-Nm-font]atoi\fP() T} \fR[\fPtty\fR]\fP33 \fR[\fPtty\fR]\fP37 \fR[\fPvt\fR]\fP05 tn\fR[\fP300\fR]\fP ti\fR[\fP700\fR]\fP tek T{ Additionally, the just-integer shorthands become speeds! How fun! T} \fR[\fP\-\fR]\fPevenp \fR[\fP\-\fR]\fPoddp \*[doc-Em-font]Could\fP correspond to some combination of \*[doc-Sy-font]parenb parodd\fP. gspeed T{ Trivial to port. Trivially, also, indicates lack of use. T} ek 😖 .TE .Pp Flags are parsed only as long as the entire argument is dashes or flags; this means, that .Fl f Ar device is disambugated from .Cm \-flusho by forbidding .Fl f Ns Ar device . This is legal per .%B IEEE P1003.2 Draft 11.2 , 2, 2.10 Utility Conventions, 2.10.2 Utility Syntax Guidelines, \fBGuideline 6:\fP & 2.10.1 Utility Argument Syntax, (2), pp. 152,147 (ll. 5173-5174,5000-5021). .Pp Additionally, as a "conversion aid", a "stdout appears redirected, but stdin is the control descriptor" is produced if you redirect the output to a different teletype: .\" Reflown; equally ass as it as originally; probably better .Bd -literal -compact -offset 4n /* * Gross, but since we're changing the control descriptor from 1 to 0, * most users will be probably be doing "stty > /dev/sometty" * by accident. If 1 and 2 are both ttys, but not the same, * assume that 1 was incorrectly redirected. */ .Ed .Pp Unless under .Dv TTYDISC , the first line in .Pf non- Fl g output starts with .Qo Li "tablet disc; " Qc Ns / Ns Qo Li "slip disc; " Qc Ns / Ns Qq Li # Ns Ar decimal-discipline-number Ns Li " disc; " , for the expected cases. Speed(s) in conformant format follow. In .Fl ae outputs, the first line ends with the window size in an updated .Qq Fa ws_row Li "rows;\&" Fa ws_col Li "columns;\&" format. In all .Pf non- Fl g outputs, the flags are formatted as .Bd -literal -compact -offset 4n lflags: icanon isig iexten echo echoe echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo -extproc .Ed (then .Li iflags , .Li oflags , .Li cflags ) , i.e. prefixed with the group, then broken after the first mode after the .Sy 72 Ns \s-3\und\d\s0 column, with groups w/o any listed modes skipped. Helpfully, continuations are indented with a tab, but the colon is followed with a space. .Pp In .Fl a (but .Em not no-argument, in clear violation of .%B IEEE P1003.2 Draft 11.2 , \(sc4.59.6.1, ll. 12390-12394) output, this is followed by all characters in .Tn POSIX format with a .Li cchars heading. .br In .Fl e and no-argument output, a saner rendition of the .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 columnated character listing is seen, insofar there's always one per cell; this listing broken .Em before it hits .Sy 72 columns, and so may look like .Bd -literal -compact -offset 4n discard dsusp eof eol eol2 erase intr kill lnext ^O ^D ^? ^C ^U ^V min quit reprint start status stop susp time werase 1 ^\e ^R ^Q ^S ^Z ^W .Ed The .Sx Special Control Characters are listed alphabetically. .Pp All formats use the same character rendering (\c .Tn POSIX Ns - and .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Seventh Edition, Virtual VAX\-11 Version, November, 1980 Ns -default-mode-compatible ) , but .Sy min time are rendered decimally. This is as present-day. .Pp In no-argument output, the default-set flags are .Sy brkint icrnl ixon ixany imaxbel opost onlcr cread hupcl isig icanon echo iexten Cm oxtabs , with .Sy cs Ns * and .Oo Sy \- Oc Ns Sy parenb always listed; this is a strict subset of .Qq Cm sane . No particular order for any of the modes can be discerned. .Pp The .Fl g output is perhaps the most novel, insofar as it starts with .Qq Li gfmt:\& through which it is discerned, but then is a list of colon-delimited fields, which are parsed in any order, distinguished as such: .Qq Li cflag= Ns Ar %x Ns Li :iflag= Ns Ar %x Ns … and likewise with .Oo Fa c_ Oc Ns Li lflag , .Oo Fa c_ Oc Ns Li oflag , all .Sx Special Control Characters by their primary names, and .Bo Li io Bc Ns Li speed (but in decimal). No exhaustiveness checking is performed, so this allows, at least theoretically, setting any subset of fields (\c .%B 4.4BSD User's Reference Manual (URM) , .Pa usr/src/bin/stty/gfmt.c ) . . .Ss X/Open CAE Specification, System Interface Definitions Issue 4, Version 2; X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2; X/Open CAE Specification, Commands and Utilities Issue 4, Version 2 Also sometimes known as the .No Single Tn UNIX No Specification Pq Dq Tn SUS \" .St -susv1 partially extract "IEEE Draft Standard P1003.2/D12" and "IEEE Std 1003.1-1990" \(em .Rs .%B X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D September 1994 .%I X/Open Company Limited .%N ISBN: 1-85912-037-7 .%N X/Open Document Number: C435 .%P p. ii .\" http://archive.opengroup.org/publications/archive/CDROM/c435.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c435.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv1/c435.pdf .\" https://pubs.opengroup.org/onlinepubs/009656499/toc.pdf .Re .Pp And are "fully compliant" with "ISO/IEC 9945-1: 1990 (POSIX-1)" and "ISO/IEC 9945-2: 1993 (POSIX-2)" \(em .%B XPG3-XPG4 Base Migration Guide, Version 2 , 1, 1.3, p. 6. .Pp And, through alignment with .Tn FIPS 151-2 , "In Issue 3, job control is defined as optional; in Issue 4, it is mandatory." and "{_POSIX_VDISABLE} is supported on all XSI-conformant systems in Issue 4, meaning that all changeable special control characters can be disabled individually", likewise optional in Issue 3 (this means that {_POSIX_VDISABLE} is always "in effect"). Internationalisation support means .Dv IUCLC , .Dv OLCUC , and .Dv XCASE are marked "TO BE WITHDRAWN" (ibid., Chapter 2 General Portability Issues, 2.8 General Terminal Interface, p. 30). .Pp The .In termios.h section (ibid., Chapter 8 Headers, 8.3 Header Migration Information, p. 235) fails to note the marking of .Dv XCASE (though it does happen both in .%B X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 (Chapter 4 Headers, , Local Modes, p. 849) and .Rs .%B X/Open CAE Specification, System Interface Definitions Issue 4, Version 2 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D September 1994 .%I X/Open Company Limited .%N ISBN: 1-85912-036-9 .%N X/Open Document Number: C434 .%O Chapter 9 General Terminal Interface, 9.2 Parameters That Can Be Set, 9.2.5 Local Modes .%P p. 126 .\" http://archive.opengroup.org/publications/archive/CDROM/c434.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c434.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv1/c434.pdf .\" https://pubs.opengroup.org/onlinepubs/009656599/toc.pdf .Re \h'-\w'\ \ 'u'). .br And is additionally cleaned up to "align the text more exactly with the POSIX-1 standard" (explicitly disavowing any functional changes pursuant thereto) and marking all "mask name symbols for the \fIc_oflag\fP field", sans .Dv OPOST , as extensions. .Pp In \(sc, and .Em only there, .Dv OFDEL is lost. It's unclear why, but that just means that where it lives isn't specified; all other references are intact. .Pp .Fn tcgetsid \(em "get process group ID for session leader for controlling terminal" \(em is imported from .Sx UNIX\(rg System V Release 4 (\c .%B XPG3-XPG4 Base Migration Guide, Version 2 , Chapter 7 System Interfaces, p. 205; .%B X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 , Chapter 3 System Interfaces, .Fn tcgetsid , p. 650 , shaded \*[doc-Tn-font-size]UX\s0 ("X/Open UNIX Extension", "included to provide portability for applications originally written to be compiled on UNIX and UNIX-based operating systems"; ibid.\& Chapter 1 Introduction, 1.3 Feature Groups, 1.3.5 X/Open UNIX Extension, p. 4)). .Pp .Nm omits the (formerly-optional) "SWTCH control character" and "\fBloblk\fP control mode because \fIshl\fP is not supported on all systems", as well as line discipline setting w/\fBline\fP "because there is no underlying support for it in the POSIX-1 standard" (\c .%B XPG3-XPG4 Base Migration Guide, Version 2 , Chapter 4 Utilities, 4.2 Utility Migration Information, p. 79). .br The big head-scratcher is removed: .Bd -filled -compact -offset 4n The Issue 3 description of Control Mode 0 says: "Hang up line immediately. This applies to all terminal lines, not just modem lines. A SIGHUP signal is sent to all processes attached to the line.". This description is incorrect and the Issue 4 description accurately reflects the processing of modem disconnects on historical systems. .Ed And is replaced with "If the baud rate is set to 0, the modem control lines will no longer be asserted.", with the description mirrored for "\fBospeed\fP \fInumber\fP" \(em .Rs .%B X/Open CAE Specification, Commands and Utilities Issue 4, Version 2 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D September 1994 .%I X/Open Company Limited .%N ISBN: 1-185912-034-2 .%N X/Open Document Number: C436 .%O Chapter 3 Utilities, stty, OPERANDS, Control Modes, \fInumber\fP .%P p. 665 .\" http://archive.opengroup.org/publications/archive/CDROM/c436.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c436.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv1/c436.pdf .\" https://pubs.opengroup.org/onlinepubs/009656399/toc.pdf .Re .Pp In .Pf \(sc Nm stty , and .Em only there, "\fBonlcr\fP (\fB\-onlcr\fP)" is lost, It's unclear why, since it remains as a macro and as a mode. .Pp It is of little surprise, then, that .%B X/Open CAE Specification, System Interface Definitions Issue 4, Version 2 Chapter 9, 9.1 Interface Characteristics (pp. 115-120) mirrors .%B IEEE P1003.2 Draft 11.2 \(sc7.1.1 (Interface Characteristics.) perfectly, to the precision of editorial changes, except: in 9.1 Interface Characteristics, 9.1.7 Non-canonical Mode Input Processing (pp. 117-118), .Bd -filled -compact -offset 4n The ISO POSIX-1 standard does not specify whether the setting of O_NONBLOCK takes over precedence over MIN or TIME settings. Therefore, if O_NONBLOCK is set, \fIread\fP(\|) may return immediately, regardless of the setting of MIN or TIME. Also, if no data is available, \fIread\fP(\|) may either return 0, or return \-1 with \fIerrno\fP set to [EAGAIN]. .Ed and a .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B Release 3.0 Ns -equivalent .Sy erase kill eof .Sy \e Ns -escaping paragraph is appended to 9.1.9 Special characters, p. 120, predicated on .Sy iexten and shaded \*[doc-Tn-font-size]EX\s0 ("Extension", equivalent to modern-day XSI shading). .Pp The same holds for \(sc9.2 (pp. 121-127)/\(sc7.1.2, resp., with the inclusion of .Dv IUCLC .Dv IXANY (same as .%B Release 3.0 , shaded \*[doc-Tn-font-size]EX\s0, former TO BE WITHDRAWN, "In locales other than the POSIX lcoale, the mapping is unspecified.") .Sx Input Modes , the whole suite of .Sx Output Modes likewise (and .Dv OLCUC TO BE WITHDRAWN, "In locales other than the POSIX locale, the mapping is unspecified"), the .Sx Control Modes also inlining \fBTable 7-6.\fP, and clarifying that .Bd -filled -compact -offset 4n If ISTRIP is set, the value of all but the 7 low-order bits is zero, but the value of any other bits beyond CSIZE is unspecified when read. .Ed (it's unclear what this means), and for .Sx Local Modes (likewise for .Dv XCASE ) , and .Sx Special Control Characters . .Pp This is duplicated in .%B X/Open CAE Specification, System Interfaces and Headers Issue 4, Version 2 , , pp. 846-850. .Pp .Pa /dev/tty Ns 's usefulness for "programs that demand the name of a file for output" is reinstated in full glory \(em .%B X/Open CAE Specification, System Interface Definitions Issue 4, Version 2 , Chapter 8 Directpru Structure and Devices, 8.1 Directory Structure and Files, p. 113. .Pp Through .%B X/Open CAE Specification, Commands and Utilities Issue 4, Version 2 , stty (pp. 664-672)'s alignment, all the \*[doc-Tn-font-size]EX\s0-shaded modes' operands are also shaded \*[doc-Tn-font-size]EX\s0 (as are "\fBraw\fP (\fB\-raw\fP or \fBcooked\fP)", "\fBlcase (\-lcase)\fP", "\fBLCASE (\-LCASE)\fP", and "\fBtabs\fP (\fB\-tabs\fP or \fBtab8\fP)") and "\fBloblk (\-loblk)\fP" and "\fBline\fP \fIi\fP" are lost, and so are the references to output modes in "\fBnl (\-nl)\fP" (the reasoning for this is unclear, they very well could just be individually shaded \*[doc-Tn-font-size]EX\s0). .Pp What's unexpected (and undocumented), though, is that in "\fBraw\fP …", rather than inheriting the prose description, becomes .Bd -filled -compact -offset 4n Enable (disable) raw input and output. Raw mode is equivalent to setting: .Ed .Bd -literal -compact -offset 7n stty cs8 erase ^- kill ^- intr ^- \e quit ^- eof ^- eol ^- \-opost \-inpck .Ed which is equivalent but nevertheless odd, and the lack of the obverse description remains, and the editor's hyperopia in "\fBtabs\fP …" is doubled down on by being described as "Equivalent to tab3.". .Pp Ibid., STDOUT changes the disabled-character value to "". . .Ss CAE Specification, Commands and Utilities, Issue 5; CAE Specification, System Interface Definitions, Issue 5; CAE Specification, System Interfaces and Headers, Issue 5 Also sometimes .St -susv2 ; relabels the TO BE WITHDRAWN flags LEGACY \(em .Rs .%B CAE Specification, System Interfaces and Headers, Issue 5 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D February 1997 .%I The Open Group .%N ISBN: 1-85912-181-0 .%N X/Open Document Number: C606 .%O Chapter 4 Headers, .%P pp. 1185-1189 .\" http://archive.opengroup.org/publications/archive/CDROM/c606.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c606.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv2/c606.pdf .\" https://pubs.opengroup.org/onlinepubs/009639399/toc.pdf .Re .br Where the former is removed (ibid., Chapter 1 Introduction, 1.4 Changes from Issue 4, 1.4.2 Changes from Issue 4, Version 2 to Issue 5, p. 6) and the latter is now defined as formerly-mandatory (ibid., 1.3 Feature Groups, 1.3.4 Legacy, p. 4). .Pp This is mirrored in .Rs .%B CAE Specification, System Interface Definitions, Issue 5 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D February 1997 .%I The Open Group .%N ISBN: 1-85912-186-1 .%N X/Open Document Number: C605 .%O Chapter 9 General Terminal Interface, 9.2 Parameters that Can be Set .%P pp. 125-130 .\" http://archive.opengroup.org/publications/archive/CDROM/c605.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c605.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv2/c605.pdf .\" https://pubs.opengroup.org/onlinepubs/009639499/toc.pdf .Re .Pp As well as .Rs .%B CAE Specification, Commands and Utilities, Issue 5 .%C Apex Plaza, Forbury Road, Reading, Berkshire, RG1 1AX, United Kingdom .%D February 1997 .%I The Open Group .%N ISBN: 1-85912-191-8 .%N X/Open Document Number: C604 .%O Chapter 3 Utilities, stty .%P pp. 690-694 .\" http://archive.opengroup.org/publications/archive/CDROM/c604.pdf .%U http://archive.opengroup.org/\:publications/\:archive/\:CDROM/\:c604.pdf .\" https://www.opengroup.org/austin/restricted/archive/susv2/c604.pdf .\" https://pubs.opengroup.org/onlinepubs/009639599/toc.pdf .Re .Pp The editor's least favourite mode finally becomes "\fBtabs\fP (\fB\-tabs\fP or \fBtab3\fP)", and loses "Equivalent to tab3." \(en the .Sx CHANGE HISTORY calls this "The description of \fBtabs\fP is clarified" (ibid., p. 696). .\" Also there's a IEEE Std. 1003.2b FUTURE DIRECTIONS thing. dont care tho . .Ss IEEE Std 1003.1-2001, Open Group Technical Standard, Base Specifications, Issue 6 Equivalent to .St -susv3 , removes LEGACY are removed and re-shades \*[doc-Tn-font-size]EX\s0 with \*[doc-Tn-font-size]XSI\s0 ("Extension", X/Open System Interface Extension) \(em .Rs .%B 1003.1\(tm, Standard for Information Technology \(em Portable Operating System Interface (POSIX\(rg), Base Definitions, Issue 6 .%D 6 Devember 2001 .%I The Open Group .%N ISBN: U.K. 1-85912-247-7 U.S. 1-931624-07-0 .%N Document Number: C950 .%O Chapter 11 General Terminal Interface, 11.1 Interface Characteristics, 11.1.9 Special Characters & 11.2 Parameters that Can be Set .%P p. 190 (ll. 6777-6778) & pp. 191-194 (ll. 6807-6929) .\" http://www.oldlinux.org/Linux.old/Ref-docs/POSIX/C950.pdf .%U http://www.oldlinux.org/\:Linux.old/\:Ref-docs/\:POSIX/\:C950.pdf .\" cf. https://pubs.opengroup.org/onlinepubs/009695099/basedefs .Re .Pp This is mirrored in ibid., Chapter 13 Headers, , pp. 379-381. .Pp .Bd -filled -compact -offset 4n Setting the input baud rate to zero was a mechanism to allow for split baud rates. Clarifications in this volume of IEEE Std 1003.1-2001 have made it possible to determine whether split rates are supported and to support them without having to treat zero as a special case. Since this functionality is also confusing, it has been declared obsolescent. .Ed It is unclear what these clarifications are, and the declaration is likewise not reflected in the text \(em .Rs .%B 1003.1\(tm, Standard for Information Technology \(em Portable Operating System Interface (POSIX\(rg), System Interfaces, Issue 6 .%D 6 Devember 2001 .%I The Open Group .%N ISBN: U.K. 1-85912-252-3 U.S. 1-931624-08-9 .%N Document Number: C951 .%O Chapter 3 System Interfaces, cfgetispeed(\|) .%P p. 178 .\" http://www.oldlinux.org/Linux.old/Ref-docs/POSIX/C951.pdf .%U http://www.oldlinux.org/\:Linux.old/\:Ref-docs/\:POSIX/\:C951.pdf .\" cf. https://pubs.opengroup.org/onlinepubs/009695099/functions .Re .Pp It may be that this corresponds to, rather than allowing .Fn tcgetattr to return with a .Vt "struct termios" whose input speed is .Sy 0 if asymmetric speeds are unsupported (formerly shaded \*[doc-Tn-font-size]EX\s0), requiring that .Bd -filled -compact -offset 4n If the terminal device does not support split baud rates, the input baud rate stored in the \fBtermios\fP structure shall be the output rate (as one of the symbolic values). .Ed (ibid., tcgetattr(\|), pp. 1489-1490). This is additionally questionable, since implementations are free to support arbitrary speeds: if the output speed is not one of the baseline listed in the equivalent of .%B IEEE Std 1003.1-1988 \fBTable 7-6.\fP .Em and the device is symmetric \(em is the input speed to be fudged to one of the standard ones? .Pp The removals and reshades are further mirrored in .Rs .%B 1003.1\(tm, Standard for Information Technology \(em Portable Operating System Interface (POSIX\(rg), Shell and Utilitie, Issue 6 .%D 6 Devember 2001 .%I The Open Group .%N ISBN: U.K. 1-85912-257-4 U.S. 1-931624-09-7 .%N Document Number: C952 .%O Chapter 4 Utilities, stty .%P pp. 883-887 .\" http://www.oldlinux.org/Linux.old/Ref-docs/POSIX/C952.pdf .%U http://www.oldlinux.org/\:Linux.old/\:Ref-docs/\:POSIX/\:C952.pdf .\" https://pubs.opengroup.org/onlinepubs/009695099/utilities/stty.html .Re .br Notably, all .Em but .Sy \-xcase are noted in the .Sx CHANGE HISTORY . .Pp Additionally, "\fBtabs\fP (\fB\-tabs\fP or \fBtab3\fP)" is moved up from .Sx Combination Modes up to the .Sx Output Modes , after the \fBtab\fP* delays, as "\fBtabs\fP (\fB\-tabs\fP)" \(en "Synonym for \fBtab0\fP (\fBtab3\fP)"; this is likewise unnoted in the .Sx CHANGE HISTORY , most likely because it is just editorial, as is the split of .Sy min time into separate cells with their own otherwise-identical descriptions. .Pp Ibid., STDOUT (p. 888) changes the disabled-character value to "\fIundef\fP". This is very much in error (most likely as part of reducing other .So Sy < Sc Ns / Ns Sq Sy > pairs, like the ones in the format specification just above) and an invention of the editor. . .Ss The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition Includes "IEEE Std 1003.1-2001/Cor 1-2002" (Technical Corrigendum 1), fixing "an error in the OPERANDS section for the Combination Modes \fBnl\fP( \fB-nl\fP).", which, indeed, now starts with "Disable (enable) \fBicrnl\fP." \(em .Rs .%B The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition .%D 2004 .%I The IEEE and The Open Group .%O XCU, 4. Utilities, stty, OPERANDS, Combination Modes .\" https://pubs.opengroup.org/onlinepubs/009695099/utilities/stty.html .%U https://pubs.opengroup.org/\:onlinepubs/\:009695099/\:utilities/\:stty.html .Re . .Ss The Open Group Base Specifications Issue 7, IEEE Std 1003.1\(tm-2008 Unshades .Dv IXANY Ns / Ns Qq "\fBixany\ \fP (\fB-ixany\fP)" \s-2\v'-.1v'[XSI]\v'.1v'\s0 \(em .Rs .%B The Open Group Base Specifications Issue 7, IEEE Std 1003.1\(tm-2008 .%D 2004 .%I The IEEE and The Open Group .%O XBD, 11. General Terminal Interface, 11.2 Parameters that Can be Set, 11.2.2 Input Modes & XBD, 13. Headers, , DESCRIPTION, Input Modes & XCU, 4. Utilities, stty, OPERANDS, Input Modes .%P basedefs/\:V1_chap11.html & basedefs/\:termios.h.html & utilities/\:stty.html .\" https://pubs.opengroup.org/onlinepubs/9699919799.2008edition .%U https://pubs.opengroup.org/\:onlinepubs/\:9699919799.2008edition .Re .Pp The interpretation referenced for this change \(em .\" https://collaboration.opengroup.org/austin/interps/documents/14535/AI-144.txt .Lk https://collaboration.opengroup.org/\:austin/\:interps/\:documents/\:14535/\:AI-144.txt "Austin Group Interpretation 1003.1-2001 #144" \(em doesn't provide any rationale, and mentions it once, tersely, as "do it", in the editor's notes. .Pp The meat of the interpretation is the only other change, and concerns the introduction of .Dv O_TTY_INIT , which is out of scope here. . .Ss The Open Group Base Specifications Issue 7, IEEE Std 1003.1\(tm-2008, 2016 Edition Reinstates "\fBonlcr\ \fP (\fB-onlcr\fP)" with only editorial description changes as part of Technical Corrigendum 2 \(em .Rs .%B The Open Group Base Specifications Issue 7, IEEE Std 1003.1\(tm-2008, 2016 Edition .%D 2016 .%I The IEEE and The Open Group .%O XCU, 4. Utilities, stty, OPERANDS, Combination Modes .\" https://pubs.opengroup.org/onlinepubs/9699919799.2016edition/utilities/stty.html .%U https://pubs.opengroup.org/\:onlinepubs/\:9699919799.2016edition/\:utilities/\:stty.html .Re . .Ss P1003.1\(tm-202x, Draft 2.1, August 2021 Imports the inimitable .%B PRM, 4.3 Berkeley Software Distribution .Dv SIGWINCH , .Dv TIOC Ns Bo Dv GS Bc Ns Dv WINSZ , .Nm Cm size , .Nm Ns \& Sy rows , .Nm Ns \& Sy cols , and .Vt "struct winsize" , reduced to at least: .Bd -literal -compact -offset 4n unsigned short ws_row\fR\h'\w'all defii'u'Rows, in characters.\fP unsigned short ws_col\fR\h'\w'all defii'u'Columns, in characters.\fP .Ed (one may recognise these descriptions as also imported verbatim) \(em .Nm .Rs .%B P1003.1\(tm-202x/D2.1, Draft Standard for Information Technology — Portable Operating System Interface (POSIX\(tm) .%D August 2021 .%I IEEE Computer Society .%I The Open Group .%N Issue 8 .%O XBD, Chapter 14 Headers, , The winsize Structure .%P p. 415 .\" https://www.opengroup.org/austin/restricted/202x-d2.1/202x_d2.1.pdf .%U https://www.opengroup.org/\:austin/\:restricted/\:202x-d2.1/\:202x_d2.1.pdf .Re .Pp .Nm ioctl Ns Pq Dv TIOC Ns Bo Dv GS Bc Ns Dv WINSZ is, naturally, imported as functions, freshly designated .Nm tc Ns Bo Nm gs Bc Ns Fn etwinsize \(em ibid., XSH, Chapter 3 System Interfaces, tcgetwinsize(\|) & tcsetwinsize(\|) (pp. 2088-2091 & 2099-2100; ll. 67626-27765 & 67981-68045). The reason for not standardising .Fa ws_ Ns Bo Fa xy Bc Ns Fa pixel is noted as "With current hardware, it is not obvious that the \fBunsigned short\fP type used for those fields is sufficient and no uses of these fields in portable code were found." (ibid., tcsetwinsize(\|), RATIONALE, p. 2100 (ll. 68031-68038)), which is perhaps too cautious on the former front. .Pp .Fn tcsetwinsize , like all other teletype-configuration functions, acts as a .Fn write for the purposes of .Dv TOSTOP (this matches .%B PRM, 4.3 Berkeley Software Distribution , but isn't documented there) \(em ibid., XBD, Chapter 11 General Terminal Interface, 11.1 interface Characteristics, 11.1.4 Terminal Access Control, para. 3, p. 185 (ll. 6522-6525). .Pp .Nm is naturally extended with more .\" TODO?: this is broken on mandoc; https://inbox.vuxu.org/mandoc-discuss/20221012220824.hhqgvlci4x74k3qc@tarta.nabijaczleweli.xyz/T/#u .%B PRM, 4.3 Berkeley Software Distribution Ns -compatible capabilities, outlined below (ibid., XCU, Chapter 3 Utilities, stty, pp. 3181-3190 (ll. 3181-108312)), .Pp .TS lb s s l1i l1 l . Terminal Window Size _ \fBrows\fP number \(<- Set the number of rows in the terminal window size to the number given. \fBcols\fP number \(<- Set the number of columns in the terminal window size to the number given. .TE .sp .TS lb s s l1b l1 l . Informational Queries _ size \(<- Write the current terminal window size to standard output. .TE .Pp The no-output-if-operands clause is voided if .Sx Informational Queries are specified, and .Cm size fields are required to be separated by a space. .Pp .Fl g is forbidden from containing "any sequence that would form an Informational Query", which is relevant, because its restriction on .Em all word expansions is lifted, in that its output is allowed to field-split. This is likely to allow a simple extension of existing implementations to just append .Sy rows cols , since, in what's possibly the most evocative standards phrasing, the new mandate is for "all the current settings, optionally excluding the terminal window size". .Pp The example in ibid., APPLICATION USAGE, p. 3188 (ll. 108251-108256) is extended to save the size as .Qq Li ttysize=$(printf \&"rows %d cols %d" $(stty size)) and restore it via a separate .Nm invocation. This, in many ways, a pre-admission of defeat. Or just good exposition. .\" TODO: when the final HTML version lands, hard-diff the pubs .\" functions/{cf{g,s}et{i,o}speed,tc{g,s}etattr}.html utilities/stty.html basedefs/termios.h.html basedefs/V1_chap11.html xrat/V4_xbd_chap11.html for f in functions/{cf{g,s}et{i,o}speed,tc{g,s}etattr}.html utilities/stty.html basedefs/termios.h.html basedefs/V1_chap11.html xrat/V4_xbd_chap11.html; do git diff -w 9699919799.2008edition/$f 9699919799.2013edition/$f; done . .Ss Lies by Omission Version\~7 \*[doc-Tn-font-size]AT&T UNIX\s0/32V \" TODO: .At 32v; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=991633 is a straight-forward port of .%B Seventh Edition to the .Tn VAX-11 , and it's additionally unclear what the distribution tape looks like; the one available from the TUHS .\" https://www.tuhs.org/Archive/Distributions/USDL/32V .Pq Lk https://www.tuhs.org/\:Archive/\:Distributions/\:USDL/\:32V reads either heavily modified, or like a botched merge of .%B Sixth Edition and .%B Seventh Edition . Its derived systems (herein, .%B Seventh Edition, Virtual VAX\-11 Version, December, 1979 ) look like normal .%B Seventh Edition derivations. .Pp .Bx 4.1a Ns / Ns Bx 4.1b Ns / Ns Bx 4.1c : these naturally represent intermediate points in at least the kernel, and the latter's .Nm is wholly different from both .Sx 4.1 Berkeley distribution and .%B UNIX Programmer's Manual, 4.2 Berkeley Software Distribution, Virtual VAX\-11 Version . .Pp .Bx 4.3 Reno .Nm is entirely different from both .Bx 4.3 Tahoe (functionally the same as .%B UNIX User's Reference Manual (URM), 4.3 Berkeley Software Distribution, Virtual VAX\-11 Version , uses .Dv C Ns -family macros for .Qq Sy dec .Sy kill intr ) and .%B 4.4BSD User's Reference Manual (URM) , .Pp Likewise, .Bx 4.4 Lite differs to \(*e from .Bx 4.4 Lite2 kernel-wise and the latter fixes a minor .Qq Oo Sy \- Oc Ns Sy extproc bug. .Pp .%B UNIX Programmer's Manual \*[doc-Xr-font]/etc/tabs\fP (VII) (p. 212) and its various executable derivatives: while most often mentioned right next to .Xr stty 1 in the Introductions, these are concerned with (essentially) hardware configuration of the teletype itself, which explains why they've become part of .Lb libcurses , and are out of scope. .Pp .Bx 2 isn't a cohesive system and its .Xr tset UCB ("set terminal modes") doesn't target any particular system, and, again, uses proto-Curses via .Xr termcap UCB . As it evolves, it much more obviously starts setting up the environment for visuals \(em now part of .Lb libcurses \(em and the calling convention grows increasingly insane, from already solid base-line.