termios.4
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 4 代码 · 共 1,622 行 · 第 1/4 页
4
1,622 行
changed..IP "\fBEOL\fR" Special character on input that is recognized if the ICANON flagis set. It is an additional line delimiter, like NL. The defaultvalue is POSIX_V_DISABLE, which is used to specify that this specialcharacter is ordinarily not used..IP "\fBSUSP\fR" Special character on input that is recognized if the ISIG flag isenabled. Generates a SIGTSTP signalthat is sent to all processes in the foreground process groupassociated with the terminal. This signal is used by thejob control code to change from the current job to thecontrolling job. If ISIG is set, the SUSP character is discarded when processed.The default value is CTRL/Z (ASCII SUB)..IP "\fBSTOP\fR" Special character on both input and output that is recognized ifthe IXON (input) or IXOFF (output) flag is set.Can be used to temporarily suspend output. It is useful with CRTterminals to prevent output from disappearing before it can beread. While output is suspended, STOP characters are ignored andnot read. If IXON is set, the STOP character is discarded when processed.The default value is CTRL/S (ASCII DC3)..IP "\fBSTART\fR" Special character on both input and output that is recognized if the IXON (input) or IXOFF (output) flag is set. Canbe used to resume output that has been suspended by a STOP character. While output is not suspended, START characters areignored and not read. If IXON is set, the STOP character is discarded when processed.The default value is CTRL/Q (ASCII DC1)..IP "\fBCR\fR" Special character on input that is recognized if the ICANON flag isset. The value is (\\r) and this value is not changeable.When ICANON and ICRNL are set and IGNCR is not set, this character is translated into an NL,and it has the same effect as an NL character..IP "\fBDSUSP\fR" Special character on input used as a delayed suspend character.DSUSP is only recognized if the IEXTEN flag is set.Similar to the SUSP special character, a SIGTSTP signal isissued. The process cannot actually stop until thenext character is input. If IEXTEN is set, the DSUSP character is discarded when processed.The default value is CTRL/Y (ASCIIEM)..IP "\fBRPRNT\fR" Special character on input used to force the present input lineto be re-echoed to the terminal after a newline character. RPRNT is only recognized if the IEXTEN flag is set.If IEXTEN is set, the RPRNT character is discarded when processed.The default value is CTRL/R (ASCII DC2)..IP "\fBFLUSH\fR" Special character on input that causes output to the terminalto be flushed until another flush character is typed or more inputis received on the terminal. FLUSH is recognized only if the IEXTEN flag is set.If IEXTEN is set, the FLUSH character is discarded when processed.The default value is CTRL/O (ASCII SI)..IP "\fBWERASE\fR" Special character on input used to erase the preceding wordof the input queue. The word erase operation erases characters up to (and not including) a TAB, NL, space, or backslash(\\) character. Word erase cannot erase beyond the start of aline as delimited by NL, EOF, or EOL. WERASE is only recognized if the IEXTEN flag is set.If IEXTEN is set, the WERASE character is discarded when processed.The default value isCTRL/W (ASCII ETB)..IP "\fBLNEXT\fR" Special character on input used to disassociate any specialmeaning that the next input character has. This allows forthe input of characters that would otherwise be interpreted asspecial characters. LNEXT is only recognized if the IEXTEN flag is set.If IEXTEN is set, the LNEXT character is discarded when processed.The default value is CTRL/V (ASCII SYN)..IP "\fBQUOTE\fR" Special character on input used to enter a literal ERASE orKILL character. The same functionality could be achieved throughthe use of the LNEXT character, but QUOTE is included forbackward compatibility. The default value is a backslash (\\).QUOTE is only recognized if the IEXTEN flag is set.If IEXTEN is set, the QUOTE character is discarded when processed..PPThe values for INTR, QUIT, ERASE, KILL, EOF, EOL, SUSP, START, STOP, DSUSP, RPRNT, FLUSHWERASE, LNEXT, and QUOTE are changeable to suit individual tastes.The following special characters are local extensions of DSUSP, RPRNT, FLUSH,WERASE, LNEXT, and QUOTE..PPSpecial character functions can be disabled individually by setting them tothe constant POSIX_V_DISABLE, which is defined to be zero.The POSIX_V_DISABLE character is always read if received, and never causes a special character function. With the exception of NL and EOL, the specialcharacters cannot be passed up to the reading process..PPIf two or more special characters have the same value, the function performedwhen that character is received is undefined. More than one specialcharacter can be set to POSIX_V_DISABLE to disable the control functionnormally associated with the special character..SH Settable ParametersRoutines that need to control certain terminal I/O characteristics can do soby using the termios structure as defined in the header .PN <termios.h> . The members of this structure include:.EX Member Member Description Type Namestruct termios { 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] /* control chars */ cc_t c_line; /* line discipline */}.EE.PPThe types tcflag_t and cc_t are defined in the header .PN <termios.h> ..PP.B Input Modes.PPThe c_iflag field describes the basic terminal input control:.PP.TStab(@);lw(1i) lw(2i)._.sp 6p.HBMask Name@Description.R.sp 6p_.sp 6pIGNBRK@T{Ignore the break condition.T}BRKINT@T{Signal interrupt on break.T}IGNPAR@T{Ignore characters with parity errors.T}PARMRK@T{Mark parity errors.T}INPCK@T{Enable input parity check.T}ISTRIP@Strip character.INLCR@T{Map NL to CR on input.T}IGNCR@Ignore CR.ICRNL@T{Map CR to NL on input.T}IXON@T{Enable start/stop output control.T}IXOFF@T{Enable start/stop input control.T}.sp 6p_.TE.PPA break condition is defined as a sequence of zero-valued bits that continues for more than the time to send one byte. The entire sequenceof zero-valued bits is interpreted as a single break condition, even ifit continues for a time equivalent to more than one byte..PPIf IGNBRK is set, a break condition detected on input is ignored, that is, not put on the input queue andtherefore not read by any process. Otherwise, if BRKINT is set, the breakcondition generates a single SIGINT signal and flushes both the input and output queues. If neither IGNBRK or BRKINT is set, a break condition is readas a single \\0 (ASCII NUL), or, if PARMRK is set, as \\377,\\0,\\0..PPIf IGNPAR is set, a byte with a framing or parity error (other than break) isignored..PPIf PARMRK is set and IGNPAR is not set, a character with a framing or parity error (other than break)that is not ignored is given to the application as the 3-character sequence \\377,\\0,X, where \\377, \\0 is a 2-character flag preceding each sequence and X is the data of the character received in error. To avoid ambiguity in this case, if ISTRIP is not set, a valid character of \\377 isgiven to the application as \\377, \\377. If either IGNPAR or PARMRK is set, a framingor parity error (other than break) that is not ignored is given to the application as a single character \\0..PPIf INPCK is set, input parity checking is enabled. If INPCK is not set, inputparity checking is disabled, allowing output parity generation without inputparity errors. Parity checking can be enabled, even ifparity checking is not enabled. If parity detection is enabled, but input parity checking is disabled, the hardware thatconnects to the terminal recognizes the parity bit, but the terminalspecial file does not check whether this bit is set correctly or not..PPIf ISTRIP is set, valid input characters are first stripped to seven bits; otherwise, all eight bits are processed..PPIf INLCR is set, a received NL character is translated into a CR character. IfIGNCR is set, a received CR character is ignored (not read). If IGNCR is not set andICRNL is set, a received CR character is translated into a NL character..PPIf IXON is set, start/stop output control is enabled. A received STOP character suspends output and a received START character restarts output. WhenIXON is set, START and STOP characters are not read, but merely perform flowcontrol functions. When IXON is not set, the START and STOP characters are read..PPIf IXOFF is set, start/stop input control is enabled. The system transmitsSTOP characters which cause the terminal device to stoptransmitting data when the number of characters in the inputqueue attempt to exceed MAX_INPUT (256). As soon as the device can continue transmitting data without risk of an overflow, START characters are transmitted which cause the terminal device to resume transmitting data..PPThe initial input control value after .MS open 2is 0 (all settings off)..PP.B Output Modes.PPThe c_oflag field specifies the terminal interface's treatment of output.Because OPOST is the only output flag defined by the POSIX standard, all ofthe other definitions are local extensions to the standard. .PP.TStab(@);lw(1i) lw(2i)._.sp 6p.HBMask Name@Description.R.sp 6p_.sp 6pOPOST@Postprocess output.OLCUC@T{Map lower case to upper on output.T}ONLCR@T{Map NL to CR-NL on output.T}OCRNL@T{Map CR to NL on output.T}ONOCR@T{No CR output at column 0.T}ONLRET@T{NL performs CR function.T}OFILL@T{Use fill characters for delay.T}OFDEL@T{Fill is DEL, else NUL.T}NLDLY@T{Select new-line delays:T}NL0@T{New-line delay type 0.T}NL1@T{New-line delay type 1.T}CRDLY@T{Select carriage-return delays:T}CR0@T{Carriage-return delay type 0.T}CR1@T{Carriage-return delay type 1.T}CR2@T{Carriage-return delay type 2.T}CR3@T{Carriage-return delay type 3.T}TABDLY@T{Select horizontal-tab delays:T}TAB0@T{Horizontal-tab delay type 0.T}TAB1@T{Horizontal-tab delay type 1.T}TAB2@T{Horizontal-tab delay type 2.T}TAB3@T{Expand tabs to spaces.T}BSDLY@T{Select backspace delays:T}BS0@T{Backspace delay type 0.T}BS1@T{Backspace delay type 1.T}VTDLY@T{Select vertical-tab delays:T}VT0@T{Vertical-tab delay type 0.T}VT1@T{Vertical-tab delay type 1.T}FFDLY@T{Select form-feed delays:T}FF0@T{Form-feed delay type 0.T}FF1@T{Form-feed delay type 1.T}.sp 6p_.TE.PPIf OPOST is set, output characters are post-processed asindicated by the remaining flags. Otherwise, characters aretransmitted without change..PPIf OLCUC is set, a lowercase letter istransmitted as the corresponding uppercase letter. Thisfunction is often used in conjunction with IUCLC..PPIf ONLCR is set, the NL character is transmitted as the CR-NLcharacter pair. If OCRNL is set, the CR character istransmitted as the NL character. If ONOCR is set, no CRcharacter is transmitted when at column 0 (first position).If ONLRET is set, the NL character is assumed to do thecarriage-return function; the column pointer is set to0, and the delays specified for CR are used. Otherwisethe NL character is assumed to do just the line-feed function;the column pointer remains unchanged. The columnpointer is also set to 0 if the CR character is actuallytransmitted..PPDelay bits specify transmission stops that allow mechanical or other movement when certain characters aresent to the terminal. In all cases, a value of 0 indicatesno delay. If OFILL is set, fill characters are transmitted for delay instead of a timed delay. This isuseful for high baud rate terminals which need only aminimal delay. If OFDEL is set, the fill character is DEL.Otherwise, it is NUL..PPThe delay specifications for NLDLY, CRDLY, TABDLY, BSDLY, VTDLY andFFDLY are meant to serve as masks for the respective delay field..PPIf a form-feed or vertical-tab delay is specified, either delay lastsapproximately two seconds..PPNew-line delay lasts about 0.10 seconds. If ONLRET is set,the carriage-return delays are used instead of the new-linedelays. If OFILL is set, two fill characters are transmitted..PPCarriage-return delay for type 1 depends on the currentcolumn position, type 2 is approximately 0.10 seconds, and type 3 isapproximately 0.15 seconds. If OFILL is set, delay type 1 transmitstwo fill characters, and type 2, four fill characters..PPHorizontal-tab delay type 1 depends on the currentcolumn position. Type 2 is approximately 0.10 seconds. Type 3specifies that tabs are to be expanded into spaces. IfOFILL is set, two fill characters are transmitted forany delay..PPBackspace delay lasts about 0.05 seconds. If OFILL is set,one fill character is transmitted..PPThe actual delays depend on line speed and system load..PPThe initial output control value after open(2) is 0 (all settings off)..PP
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?