termios(3)
๐
termios(3) โ Library Functions Manual โจ
okay bestie, gather round, because this is THE page for talking to terminals. it lives in the Library Functions Manual and honestly it's a whole icon.
๐ธ NAME ๐ธ
termios, tcgetattr, tcsetattr, tcsendbreak, tcdrain, tcflush, tcflow, cfmakeraw, cfgetospeed, cfgetispeed, cfsetispeed, cfsetospeed, cfsetspeed โ literally the whole squad for getting and setting terminal attributes, doing line control, and getting/setting the baud rate ๐
๐ง LIBRARY ๐ง
Standard C library (libc, -lc) โ she's built in, no cap.
โญ SYNOPSIS โญ
#include <termios.h>
#include <unistd.h>
int tcgetattr(int fd, struct termios *termios_p);
int tcsetattr(int fd, int optional_actions,
const struct termios *termios_p);
int tcsendbreak(int fd, int duration);
int tcdrain(int fd);
int tcflush(int fd, int queue_selector);
int tcflow(int fd, int action);
void cfmakeraw(struct termios *termios_p);
speed_t cfgetispeed(const struct termios *termios_p);
speed_t cfgetospeed(const struct termios *termios_p);
int cfsetispeed(struct termios *termios_p, speed_t speed);
int cfsetospeed(struct termios *termios_p, speed_t speed);
int cfsetspeed(struct termios *termios_p, speed_t speed);
๐ฆ Feature Test Macro Requirements for glibc ๐ฆ
(peep feature_test_macros(7) if you need the lore on how these work)
cfsetspeed(), cfmakeraw():
Since glibc 2.19:
_DEFAULT_SOURCE
glibc 2.19 and earlier:
_BSD_SOURCE
๐ DESCRIPTION ๐
The termios functions are the general terminal interface, and they exist to control asynchronous communications ports. yes, that's the whole vibe: your program talks, the port listens, everybody slays. ๐
๐ The termios structure ๐
A bunch of these functions take a termios_p argument, which is just a pointer to a termios structure. That struct contains at least these members:
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 c_cc[NCCS]; /* special characters */
The values you're allowed to assign to those fields are all listed below, don't worry. for the first four bit-mask fields, heads up: some of the associated flags are only exposed if you define a specific feature test macro (again, feature_test_macros(7)), and it's noted in brackets ("[]") when that's the case. iykyk.
also, quick glossary so nobody's confused later:
- when this page says "not in POSIX", it means that value isn't specified in POSIX.1-2001.
- when it says "XSI", it means the value is specified in POSIX.1-2001 as part of the XSI extension. โญ
๐ c_iflag flag constants ๐
IGNBRKโ ignore the BREAK condition on input. like, we simply don't see it. ๐BRKINTโ ifIGNBRKis set, a BREAK is ignored. but ifIGNBRKis not set andBRKINTis set, then a BREAK causes the input and output queues to be flushed, and if the terminal is the controlling terminal of a foreground process group, it causes aSIGINTto be sent to that foreground process group. and when neitherIGNBRKnorBRKINTis set, a BREAK reads as a null byte ('\0'), except whenPARMRKis set, in which case it reads as the sequence\377 \0 \0. three scenarios, three outcomes, she's versatile ๐IGNPARโ ignore framing errors and parity errors.PARMRKโ if this bit is set, input bytes with parity or framing errors are marked when they're passed to the program. this bit is only meaningful whenINPCKis set andIGNPARis not set. the marking is done with two preceding bytes,\377and\0โ so the program actually reads three bytes for one erroneous byte received from the terminal. and if a valid byte has the value\377andISTRIP(see below) is not set, the program might confuse it with the prefix that marks a parity error. therefore, a valid byte\377is passed to the program as two bytes,\377 \377, in this case. ๐ญ
if neither IGNPAR nor PARMRK is set, read a character with a parity error or framing error as \0.
INPCKโ enable input parity checking. vibe check for your parity โจISTRIPโ strip off the eighth bit.INLCRโ translate NL to CR on input.IGNCRโ ignore carriage return on input.ICRNLโ translate carriage return to newline on input (unlessIGNCRis set).IUCLCโ (not in POSIX) map uppercase characters to lowercase on input.IXONโ enable XON/XOFF flow control on output.IXANYโ (XSI) typing any character will restart stopped output. (the default is to allow just the START character to restart output.)IXOFFโ enable XON/XOFF flow control on input.IMAXBELโ (not in POSIX) ring the bell when the input queue is full. Linux does not implement this bit, and acts as if it's always set. she's permanently ringing, iconic ๐IUTF8(since Linux 2.6.4) โ (not in POSIX) input is UTF8; this allows character-erase to be correctly performed in cooked mode. ๐
๐ c_oflag flag constants ๐
OPOSTโ enable implementation-defined output processing.OLCUCโ (not in POSIX) map lowercase characters to uppercase on output.ONLCRโ (XSI) map NL to CR-NL on output.OCRNLโ map CR to NL on output.ONOCRโ don't output CR at column 0.ONLRETโ the NL character is assumed to do the carriage-return function; the kernel's idea of the current column is set to 0 after both NL and CR.OFILLโ send fill characters for a delay, rather than using a timed delay.OFDELโ fill character is ASCII DEL (0177). if unset, the fill character is ASCII NUL ('\0'). (not implemented on Linux.)NLDLYโ newline delay mask. values areNL0andNL1. [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]CRDLYโ carriage return delay mask. values areCR0,CR1,CR2, orCR3. [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]TABDLYโ horizontal tab delay mask. values areTAB0,TAB1,TAB2,TAB3(orXTABS, but see the BUGS section ๐). a value ofTAB3, that isXTABS, expands tabs to spaces (with tab stops every eight columns). [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]BSDLYโ backspace delay mask. values areBS0orBS1. (has never been implemented.) [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]VTDLYโ vertical tab delay mask. values areVT0orVT1.FFDLYโ form feed delay mask. values areFF0orFF1. [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]
๐ฅ c_cflag flag constants ๐ฅ
CBAUDโ (not in POSIX) baud speed mask (4+1 bits). [requires_BSD_SOURCEor_SVID_SOURCE]CBAUDEXโ (not in POSIX) extra baud speed mask (1 bit), included inCBAUD. [requires_BSD_SOURCEor_SVID_SOURCE]
(POSIX says the baud speed is stored in the termios structure without specifying where precisely, and provides cfgetispeed() and cfsetispeed() for getting at it. some systems use bits selected by CBAUD in c_cflag, other systems use separate fields, for example, sg_ispeed and sg_ospeed.) โ so she's stored, she's just not telling you where ๐
CSIZEโ character size mask. values areCS5,CS6,CS7, orCS8.CSTOPBโ set two stop bits, rather than one. two is the moment.CREADโ enable receiver.PARENBโ enable parity generation on output and parity checking for input.PARODDโ if set, then parity for input and output is odd; otherwise even parity is used.HUPCLโ lower modem control lines after the last process closes the device (hang up).CLOCALโ ignore modem control lines.LOBLKโ (not in POSIX) block output from a noncurrent shell layer. for use byshl(shell layers). (not implemented on Linux.)CIBAUDโ (not in POSIX) mask for input speeds. the values for theCIBAUDbits are the same as the values for theCBAUDbits, shifted leftIBSHIFTbits. [requires_BSD_SOURCEor_SVID_SOURCE] (not implemented in glibc, supported on Linux via theTCGET*andTCSET*ioctls; seeioctl_tty(2))CMSPARโ (not in POSIX) use "stick" (mark/space) parity (supported on certain serial devices): ifPARODDis set, the parity bit is always1; ifPARODDis not set, then the parity bit is always0. [requires_BSD_SOURCEor_SVID_SOURCE]CRTSCTSโ (not in POSIX) enable RTS/CTS (hardware) flow control. [requires_BSD_SOURCEor_SVID_SOURCE]
๐ซถ c_lflag flag constants ๐ซถ
ISIGโ when any of the charactersINTR,QUIT,SUSP, orDSUSPare received, generate the corresponding signal. โกICANONโ enable canonical mode (described below).XCASEโ (not in POSIX; not supported under Linux) ifICANONis also set, the terminal is uppercase only. input is converted to lowercase, except for characters preceded by\. on output, uppercase characters are preceded by\and lowercase characters are converted to uppercase. [requires_BSD_SOURCEor_SVID_SOURCEor_XOPEN_SOURCE]ECHOโ echo input characters. she said it back ๐ฌECHOEโ ifICANONis also set, theERASEcharacter erases the preceding input character, andWERASEerases the preceding word.ECHOKโ ifICANONis also set, theKILLcharacter erases the current line.ECHONLโ ifICANONis also set, echo the NL character even ifECHOis not set.ECHOCTLโ (not in POSIX) ifECHOis also set, terminal special characters other than TAB, NL, START, and STOP are echoed as^X, where X is the character with ASCII code0x40greater than the special character. for example, character0x08(BS) is echoed as^H. [requires_BSD_SOURCEor_SVID_SOURCE]ECHOPRTโ (not in POSIX) ifICANONandECHOare also set, characters are printed as they're being erased. [requires_BSD_SOURCEor_SVID_SOURCE]ECHOKEโ (not in POSIX) ifICANONis also set,KILLis echoed by erasing each character on the line, as specified byECHOEandECHOPRT. [requires_BSD_SOURCEor_SVID_SOURCE]DEFECHOโ (not in POSIX) echo only when a process is reading. (not implemented on Linux.)FLUSHOโ (not in POSIX; not supported under Linux) output is being flushed. this flag is toggled by typing theDISCARDcharacter. [requires_BSD_SOURCEor_SVID_SOURCE]NOFLSHโ disable flushing the input and output queues when generating signals for theINT,QUIT, andSUSPcharacters.TOSTOPโ send theSIGTTOUsignal to the process group of a background process which tries to write to its controlling terminal.PENDINโ (not in POSIX; not supported under Linux) all characters in the input queue are reprinted when the next character is read. (bash(1)handles typeahead this way.) [requires_BSD_SOURCEor_SVID_SOURCE]IEXTENโ enable implementation-defined input processing. this flag, as well asICANON, must be enabled for the special charactersEOL2,LNEXT,REPRINT,WERASEto be interpreted, and for theIUCLCflag to be effective.
๐ the c_cc array ๐
The c_cc array defines the terminal special characters. the symbolic indices (initial values) and what each of them means are coming up next โ stay tuned bestie, there's more ๐โจ
VDISCARDโ not in POSIX, not supported under Linux;017,SI,Ctrl-O. Toggle: start/stop discarding pending output. Recognized whenIEXTENis set, and then not passed as input.VDSUSPโ not in POSIX, not supported under Linux;031,EM,Ctrl-Y. Delayed suspend character (DSUSP): sendSIGTSTPsignal when the character is read by the user program. Recognized whenIEXTENandISIGare set, and the system supports job control, and then not passed as input.VEOFโ004,EOT,Ctrl-D. End-of-file character (EOF). More precisely: this character causes the pending tty buffer to be sent to the waiting user program without waiting for end-of-line. If it is the first character of the line, theread(2)in the user program returns0, which signifies end-of-file. Recognized whenICANONis set, and then not passed as input.VEOLโ0,NUL. Additional end-of-line character (EOL). Recognized whenICANONis set.VEOL2โ not in POSIX;0,NUL. Yet another end-of-line character (EOL2). Recognized whenICANONis set.VERASEโ0177,DEL,rubout, or010,BS,Ctrl-H, or also#. Erase character (ERASE). This erases the previous not-yet-erased character, but does not erase pastEOFor beginning-of-line. Recognized whenICANONis set, and then not passed as input.VINTRโ003,ETX,Ctrl-C, or also0177,DEL,rubout. Interrupt character (INTR). Send aSIGINTsignal. Recognized whenISIGis set, and then not passed as input.VKILLโ025,NAK,Ctrl-U, orCtrl-X, or also@. Kill character (KILL). This erases the input since the lastEOFor beginning-of-line. Recognized whenICANONis set, and then not passed as input.VLNEXTโ not in POSIX;026,SYN,Ctrl-V. Literal next (LNEXT). Quotes the next input character, depriving it of a possible special meaning. Recognized whenIEXTENis set, and then not passed as input.VMINโ Minimum number of characters for noncanonical read (MIN).VQUITโ034,FS,Ctrl-\. Quit character (QUIT). SendSIGQUITsignal. Recognized whenISIGis set, and then not passed as input.VREPRINTโ not in POSIX;022,DC2,Ctrl-R. Reprint unread characters (REPRINT). Recognized whenICANONandIEXTENare set, and then not passed as input.VSTARTโ021,DC1,Ctrl-Q. Start character (START). Restarts output stopped by the Stop character. Recognized whenIXONis set, and then not passed as input.VSTATUSโ not in POSIX, not supported under Linux; status request:024,DC4,Ctrl-T. Status character (STATUS). Display status information at terminal, including state of foreground process and amount of CPU time it has consumed. Also sends aSIGINFOsignal (not supported on Linux) to the foreground process group.VSTOPโ023,DC3,Ctrl-S. Stop character (STOP). Stop output until Start character typed. Recognized whenIXONis set, and then not passed as input.VSUSPโ032,SUB,Ctrl-Z. Suspend character (SUSP). SendSIGTSTPsignal. Recognized whenISIGis set, and then not passed as input.VSWTCHโ not in POSIX, not supported under Linux;0,NUL. Switch character (SWTCH). Used in System V to switch shells in shell layers, a predecessor to shell job control.VTIMEโ Timeout in deciseconds for noncanonical read (TIME).VWERASEโ not in POSIX;027,ETB,Ctrl-W. Word erase (WERASE). Recognized whenICANONandIEXTENare set, and then not passed as input.
An individual terminal special character can be disabled by setting the value of the corresponding c_cc element to _POSIX_VDISABLE.
The above symbolic subscript values are all different, except that VTIME, VMIN may have the same value as VEOL, VEOF, respectively. In noncanonical mode, the special character meaning is replaced by the timeout meaning. For an explanation of VMIN and VTIME, see the description of noncanonical mode below.
๐ง Retrieving and changing terminal settings ๐ง
tcgetattr() gets the parameters associated with the object referred by fd, and stores them in the termios structure referenced by termios_p. This function may be invoked from a background process; however, the terminal attributes may be subsequently changed by a foreground process.
tcsetattr() sets the parameters associated with the terminal (unless support is required from the underlying hardware that is not available) from the termios structure referred to by termios_p. optional_actions specifies when the changes take effect:
TCSANOWโ the change occurs immediately.TCSADRAINโ the change occurs after all output written tofdhas been transmitted. This option should be used when changing parameters that affect output.TCSAFLUSHโ the change occurs after all output written to the object referred byfdhas been transmitted, and all input that has been received but not read will be discarded before the change is made.
๐ธ Canonical and noncanonical mode ๐ธ
The setting of the ICANON canon flag in c_lflag determines whether the terminal is operating in canonical mode (ICANON set) or noncanonical mode (ICANON unset). By default, ICANON is set.
In canonical mode:
- Input is made available line by line. An input line is available when one of the line delimiters is typed (
NL,EOL,EOL2; orEOFat the start of line). Except in the case ofEOF, the line delimiter is included in the buffer returned byread(2). - Line editing is enabled (
ERASE,KILL; and if theIEXTENflag is set:WERASE,REPRINT,LNEXT). Aread(2)returns at most one line of input; if theread(2)requested fewer bytes than are available in the current line of input, then only as many bytes as requested are read, and the remaining characters will be available for a futureread(2). - The maximum line length is
4096chars (including the terminating newline character); lines longer than4096chars are truncated. After4095characters, input processing (e.g.,ISIGandECHO*processing) continues, but any input data after4095characters up to (but not including) any terminating newline is discarded. This ensures that the terminal can always receive more input until at least one line can be read.
In noncanonical mode input is available immediately (without the user having to type a line-delimiter character), no input processing is performed, and line editing is disabled. The read buffer will only accept 4095 chars; this provides the necessary space for a newline char if the input mode is switched to canonical. The settings of MIN (c_cc[VMIN]) and TIME (c_cc[VTIME]) determine the circumstances in which a read(2) completes; there are four distinct cases:
MIN == 0, TIME == 0 (polling read)
If data is available, read(2) returns immediately, with the lesser of the number of bytes available, or the number of bytes requested. If no data is available, read(2) returns 0.
MIN > 0, TIME == 0 (blocking read)
read(2) blocks until MIN bytes are available, and returns up to the number of bytes requested.
MIN == 0, TIME > 0 (read with timeout)
TIME specifies the limit for a timer in tenths of a second. The timer is started when read(2) is called. read(2) returns either when at least one byte of data is available, or when the timer expires. If the timer expires without any input becoming available, read(2) returns 0. If data is already available at the time of the call to read(2), the call behaves as though the data was received immediately after the call.
MIN > 0, TIME > 0 (read with interbyte timeout)
TIME specifies the limit for a timer in tenths of a second. Once an initial byte of input becomes available, the timer is restarted after each further byte is received. read(2) returns when any of the following conditions is met:
MINbytes have been received.- The interbyte timer expires.
- The number of bytes requested by
read(2)has been received. (POSIX does not specify this termination condition, and on some other implementationsread(2)does not return in this case.)
Because the timer is started only after the initial byte becomes available, at least one byte will be read. If data is already available at the time of the call to read(2), the call behaves as though the data was received immediately after the call.
POSIX does not specify whether the setting of the O_NONBLOCK file status flag takes precedence over the MIN and TIME settings. If O_NONBLOCK is set, a read(2) in noncanonical mode may return immediately, regardless of the setting of MIN or TIME. Furthermore, if no data is available, POSIX permits a read(2) in noncanonical mode to return either 0, or -1 with errno set to EAGAIN.
๐ฆ Raw mode ๐ฆ
cfmakeraw() sets the terminal to something like the "raw" mode of the old Version 7 terminal driver: input is available character by character, echoing is disabled, and all special processing of terminal input and output characters is disabled. The terminal attributes are set as follows:
termios_p->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP
| INLCR | IGNCR | ICRNL | IXON);
termios_p->c_oflag &= ~OPOST;
termios_p->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
termios_p->c_cflag &= ~(CSIZE | PARENB);
termios_p->c_cflag |= CS8;
๐ Line control ๐
tcsendbreak() transmits a continuous stream of zero-valued bits for a specific duration, if the terminal is using asynchronous serial data transmission. If duration is zero, it transmits zero-valued bits for at least 0.25 seconds, and not more than 0.5 seconds. If duration is not zero, it sends zero-valued bits for some implementation-defined length of time.
If the terminal is not using asynchronous serial data transmission, tcsendbreak() returns without taking any action.
tcdrain() waits until all output written to the object referred to by fd has been transmitted.
tcflush() discards data written to the object referred to by fd but not transmitted, or data received but not read, depending on the value of queue_selector:
TCIFLUSHโ flushes data received but not read.TCOFLUSHโ flushes data written but not transmitted.TCIOFLUSHโ flushes both data received but not read, and data written but not transmitted.
tcflow() suspends transmission or reception of data on the object referred to by fd, depending on the value of action:
TCOOFFโ suspends output. ๐ like muting your mic mid-rant.TCOONโ restarts suspended output. โถ๏ธ unmuted, we're back.TCIOFFโ transmits a STOP character, which stops the terminal device from transmitting data to the system.TCIONโ transmits a START character, which starts the terminal device transmitting data to the system.
The default on open of a terminal file is that neither its input nor its output is suspended. โจ so bestie, you start un-suspended by default. iconic behavior tbh.
๐ Line speed ๐
The baud rate functions are provided for getting and setting the values of the input and output baud rates in the termios structure. Heads up: the new values do not take effect until tcsetattr() is successfully called. ๐
so like, you're setting the vibe but the party doesn't start till tcsetattr() says so.
Setting the speed to B0 instructs the modem to "hang up". ๐ญ The actual bit rate corresponding to B38400 may be altered with setserial(8).
The input and output baud rates are stored in the termios structure.
cfgetospeed()โ returns the output baud rate stored in thetermiosstructure pointed to by termios_p.cfsetospeed()โ sets the output baud rate stored in thetermiosstructure pointed to by termios_p to speed, which must be one of these constants:
B0
B50
B75
B110
B134
B150
B200
B300
B600
B1200
B1800
B2400
B4800
B9600
B19200
B38400
B57600
B115200
B230400
B460800
B500000
B576000
B921600
B1000000
B1152000
B1500000
B2000000
These constants are additionally supported on the SPARC architecture only:
B76800
B153600
B307200
B614400
And these are additionally supported on non-SPARC architectures:
B2500000
B3000000
B3500000
B4000000
Due to differences between architectures, portable applications should check if a particular Bnnn constant is defined prior to using it. ๐ซถ fr fr, don't assume.
The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines shall no longer be asserted. Normally, this will disconnect the line. CBAUDEX is a mask for the speeds beyond those defined in POSIX.1 (57600 and above). Thus, B57600 & CBAUDEX is nonzero. ๐ฅ
Setting the baud rate to a value other than those defined by Bnnn constants is possible via the TCSETS2 ioctl; see ioctl_tty(2).
cfgetispeed()โ returns the input baud rate stored in thetermiosstructure.cfsetispeed()โ sets the input baud rate stored in thetermiosstructure to speed, which must be specified as one of theBnnnconstants listed above forcfsetospeed(). If the input baud rate is set to the literal constant0(not the symbolic constantB0), the input baud rate will be equal to the output baud rate. ๐ก yes,0andB0are two completely different girlies. don't mix them up.cfsetspeed()โ a 4.4BSD extension. It takes the same arguments ascfsetispeed(), and sets both input and output speed. ๐ two birds, one call.
๐ RETURN VALUE ๐
cfgetispeed()โ returns the input baud rate stored in thetermiosstructure. โญcfgetospeed()โ returns the output baud rate stored in thetermiosstructure. โญ
All other functions return:
0โ on success. ๐ slay.-1โ on failure and seterrnoto indicate the error. ๐
Note thattcsetattr()returns success if any of the requested changes could be successfully carried out. Therefore, when making multiple changes, it may be necessary to follow this call with a further call totcgetattr()to check that all changes have been performed successfully. ๐ญ not her being like "yeah sure whatever worked" โ you gotta double-check, bestie.
๐ฆ ATTRIBUTES ๐ฆ
For an explanation of the terms used in this section, see attributes(7).
Every single one of these is Thread safety: MT-Safe ๐ โ the whole squad:
- Interface:
tcgetattr(),tcsetattr(),tcdrain(),tcflush(),tcflow(),tcsendbreak(),cfmakeraw(),cfgetispeed(),cfgetospeed(),cfsetispeed(),cfsetospeed(),cfsetspeed() - Attribute: Thread safety
- Value:
MT-Safe
๐ธ STANDARDS ๐ธ
tcgetattr(),tcsetattr(),tcsendbreak(),tcdrain(),tcflush(),tcflow(),cfgetispeed(),cfgetospeed(),cfsetispeed(),cfsetospeed()โ POSIX.1-2008 ๐cfmakeraw(),cfsetspeed()โ BSD ๐
โญ HISTORY โญ
tcgetattr(),tcsetattr(),tcsendbreak(),tcdrain(),tcflush(),tcflow(),cfgetispeed(),cfgetospeed(),cfsetispeed(),cfsetospeed()โ POSIX.1-2001 ๐cfmakeraw(),cfsetspeed()โ BSD ๐
๐ง NOTES ๐ง
UNIX V7 and several later systems have a list of baud rates where after the values B0 through B9600 one finds the two constants EXTA, EXTB ("External A" and "External B"). Many systems extend the list with much higher baud rates. ๐ฐ๏ธ vintage lore iykyk.
The effect of a nonzero duration with tcsendbreak() varies. ๐ตโ๐ซ it's giving "everyone do your own thing":
- SunOS specifies a break of duration * N seconds, where N is at least
0.25, and not more than0.5. - Linux, AIX, DU, Tru64 send a break of duration milliseconds.
- FreeBSD and NetBSD and HP-UX and MacOS ignore the value of duration. ๐
- Under Solaris and UnixWare,
tcsendbreak()with nonzero duration behaves liketcdrain().
๐ BUGS ๐
On the Alpha architecture before Linux 4.16 (and glibc before glibc 2.28), the XTABS value was different from TAB3 and it was ignored by the N_TTY line discipline code of the terminal driver as a result (because as it wasn't part of the TABDLY mask). ๐ซ yeah. that's the whole bug. it just got ignored. embarrassing for everyone involved.
๐ SEE ALSO ๐
reset(1), setterm(1), stty(1), tput(1), tset(1), tty(1), ioctl_console(2), ioctl_tty(2), cc_t(3type), speed_t(3type), tcflag_t(3type), setserial(8)
okay that's the whole page bestie, you ate that ๐ โจ This little number is from Linux man-pages 6.18, dated 2026-02-08 โ go forth and configure your terminals, mwah ๐๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: man-pages 6.18-r0 ยท GPL-2.0-or-later
- nixos 26.05: man-pages 6.18
- ๐ the page's license: GPL-2.0-or-later
- Copyright 2006-2015, Michael Kerrisk <mtk.manpages@gmail.com>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms