⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 terminal.texi

📁 一个C源代码分析器
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
@comment termios.h@comment POSIX.1@vindex B600@comment termios.h@comment POSIX.1@vindex B1200@comment termios.h@comment POSIX.1@vindex B1800@comment termios.h@comment POSIX.1@vindex B2400@comment termios.h@comment POSIX.1@vindex B4800@comment termios.h@comment POSIX.1@vindex B9600@comment termios.h@comment POSIX.1@vindex B19200@comment termios.h@comment POSIX.1@vindex B38400@smallexampleB0  B50  B75  B110  B134  B150  B200B300  B600  B1200  B1800  B2400  B4800B9600  B19200  B38400@end smallexample@vindex EXTA@vindex EXTBBSD defines two additional speed symbols as aliases: @code{EXTA} is analias for @code{B19200} and @code{EXTB} is an alias for @code{B38400}.These aliases are obsolete.@node Special Characters@subsection Special CharactersIn canonical input, the terminal driver recognizes a number of specialcharacters which perform various control functions.  These include theERASE character (usually @key{DEL}) for editing input, and other editingcharacters.  The INTR character (normally @kbd{C-c}) for sending a@code{SIGINT} signal, and other signal-raising characters, may beavailable in either canonical or noncanonical input mode.  All thesecharacters are described in this section.The particular characters used are specified in the @code{c_cc} memberof the @code{struct termios} structure.  This member is an array; eachelement specifies the character for a particular role.  Each element hasa symbolic constant that stands for the index of that element---forexample, @code{INTR} is the index of the element that specifies the INTRcharacter, so storing @code{'='} in @code{@var{termios}.c_cc[INTR]}specifies @samp{=} as the INTR character.@vindex _POSIX_VDISABLEOn some systems, you can disable a particular special character functionby specifying the value @code{_POSIX_VDISABLE} for that role.  Thisvalue is unequal to any possible character code.  @xref{Options forFiles}, for more information about how to tell whether the operatingsystem you are using supports @code{_POSIX_VDISABLE}.@menu* Editing Characters::          Special characters that terminate lines and                                  delete text, and other editing functions.* Signal Characters::           Special characters that send or raise signals                                  to or for certain classes of processes.* Start/Stop Characters::       Special characters that suspend or resume                                  suspended output.* Other Special::		Other special characters for BSD systems:				  they can discard output, and print status.@end menu@node Editing Characters@subsubsection Characters for Input EditingThese special characters are active only in canonical input mode.@xref{Canonical or Not}.@comment termios.h@comment POSIX.1@deftypevr Macro int VEOF@cindex EOF characterThis is the subscript for the EOF character in the special controlcharacter array.  @code{@var{termios}.c_cc[VEOF]} holds the characteritself.The EOF character is recognized only in canonical input mode.  It actsas a line terminator in the same way as a newline character, but if theEOF character is typed at the beginning of a line it causes @code{read}to return a byte count of zero, indicating end-of-file.  The EOFcharacter itself is discarded.Usually, the EOF character is @kbd{C-d}.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VEOL@cindex EOL characterThis is the subscript for the EOL character in the special controlcharacter array.  @code{@var{termios}.c_cc[VEOL]} holds the characteritself.The EOL character is recognized only in canonical input mode.  It actsas a line terminator, just like a newline character.  The EOL characteris not discarded; it is read as the last character in the input line.@c !!! example: this is set to ESC by 4.3 csh with "set filec" so it can@c complete partial lines without using cbreak or raw mode.You don't need to use the EOL character to make @key{RET} end a line.Just set the ICRNL flag.  In fact, this is the default state ofaffairs.@end deftypevr@comment termios.h@comment BSD@deftypevr Macro int VEOL2@cindex EOL2 characterThis is the subscript for the EOL2 character in the special controlcharacter array.  @code{@var{termios}.c_cc[VEOL2]} holds the characteritself.The EOL2 character works just like the EOL character (see above), but itcan be a different character.  Thus, you can specify two characters toterminate an input line, by setting EOL to one of them and EOL2 to theother.The EOL2 character is a BSD extension; it exists only on BSD systemsand the GNU system.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VERASE@cindex ERASE characterThis is the subscript for the ERASE character in the special controlcharacter array.  @code{@var{termios}.c_cc[VERASE]} holds thecharacter itself.The ERASE character is recognized only in canonical input mode.  Whenthe user types the erase character, the previous character typed isdiscarded.  (If the terminal generates multibyte character sequences,this may cause more than one byte of input to be discarded.)  Thiscannot be used to erase past the beginning of the current line of text.The ERASE character itself is discarded.@c !!! mention ECHOE hereUsually, the ERASE character is @key{DEL}.@end deftypevr@comment termios.h@comment BSD@deftypevr Macro int VWERASE@cindex WERASE characterThis is the subscript for the WERASE character in the special controlcharacter array.  @code{@var{termios}.c_cc[VWERASE]} holds the characteritself.The WERASE character is recognized only in canonical mode.  It erases anentire word of prior input, and any whitespace after it; whitespacecharacters before the word are not erased.The definition of a ``word'' depends on the setting of the@code{ALTWERASE} mode; @pxref{Local Modes}.If the @code{ALTWERASE} mode is not set, a word is defined as a sequenceof any characters except space or tab.If the @code{ALTWERASE} mode is set, a word is defined as a sequence ofcharacters containing only letters, numbers, and underscores, optionallyfollowed by one character that is not a letter, number, or underscore.The WERASE character is usually @kbd{C-w}.This is a BSD extension.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VKILL@cindex KILL characterThis is the subscript for the KILL character in the special controlcharacter array.  @code{@var{termios}.c_cc[VKILL]} holds the characteritself.The KILL character is recognized only in canonical input mode.  When theuser types the kill character, the entire contents of the current lineof input are discarded.  The kill character itself is discarded too.The KILL character is usually @kbd{C-u}.@end deftypevr@comment termios.h@comment BSD@deftypevr Macro int VREPRINT@cindex REPRINT characterThis is the subscript for the REPRINT character in the special controlcharacter array.  @code{@var{termios}.c_cc[VREPRINT]} holds the characteritself.The REPRINT character is recognized only in canonical mode.  It reprintsthe current input line.  If some asynchronous output has come while youare typing, this lets you see the line you are typing clearly again.The REPRINT character is usually @kbd{C-r}.This is a BSD extension.@end deftypevr@node Signal Characters@subsubsection Characters that Cause SignalsThese special characters may be active in either canonical or noncanonicalinput mode, but only when the @code{ISIG} flag is set (@pxref{LocalModes}).@comment termios.h@comment POSIX.1@deftypevr Macro int VINTR@cindex INTR character@cindex interrupt characterThis is the subscript for the INTR character in the special controlcharacter array.  @code{@var{termios}.c_cc[VINTR]} holds the characteritself.The INTR (interrupt) character raises a @code{SIGINT} signal for allprocesses in the foreground job associated with the terminal.  The INTRcharacter itself is then discarded.  @xref{Signal Handling}, for moreinformation about signals.Typically, the INTR character is @kbd{C-c}.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VQUIT@cindex QUIT characterThis is the subscript for the QUIT character in the special controlcharacter array.  @code{@var{termios}.c_cc[VQUIT]} holds the characteritself.The QUIT character raises a @code{SIGQUIT} signal for all processes inthe foreground job associated with the terminal.  The QUIT characteritself is then discarded.  @xref{Signal Handling}, for more informationabout signals.Typically, the QUIT character is @kbd{C-\}.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VSUSP@cindex SUSP character@cindex suspend characterThis is the subscript for the SUSP character in the special controlcharacter array.  @code{@var{termios}.c_cc[VSUSP]} holds the characteritself.The SUSP (suspend) character is recognized only if the implementationsupports job control (@pxref{Job Control}).  It causes a @code{SIGTSTP}signal to be sent to all processes in the foreground job associated withthe terminal.  The SUSP character itself is then discarded.@xref{Signal Handling}, for more information about signals.Typically, the SUSP character is @kbd{C-z}.@end deftypevrFew applications disable the normal interpretation of the SUSPcharacter.  If your program does this, it should provide some othermechanism for the user to stop the job.  When the user invokes thismechanism, the program should send a @code{SIGTSTP} signal to theprocess group of the process, not just to the process itself.@xref{Signaling Another Process}.@comment termios.h@comment BSD@deftypevr Macro int VDSUSP@cindex DSUSP character@cindex delayed suspend characterThis is the subscript for the DSUSP character in the special controlcharacter array.  @code{@var{termios}.c_cc[VDSUSP]} holds the characteritself.The DSUSP (suspend) character is recognized only if the implementationsupports job control (@pxref{Job Control}).  It sends a @code{SIGTSTP}signal, like the SUSP character, but not right away---only when theprogram tries to read it as input.  Not all systems with job controlsupport DSUSP; only BSD-compatible systems (including the GNU system).@xref{Signal Handling}, for more information about signals.Typically, the DSUSP character is @kbd{C-y}.@end deftypevr@node Start/Stop Characters@subsubsection Special Characters for Flow ControlThese special characters may be active in either canonical or noncanonicalinput mode, but their use is controlled by the flags @code{IXON} and@code{IXOFF} (@pxref{Input Modes}).@comment termios.h@comment POSIX.1@deftypevr Macro int VSTART@cindex START characterThis is the subscript for the START character in the special controlcharacter array.  @code{@var{termios}.c_cc[VSTART]} holds thecharacter itself.The START character is used to support the @code{IXON} and @code{IXOFF}input modes.  If @code{IXON} is set, receiving a START character resumessuspended output; the START character itself is discarded.  If@code{IXANY} is set, receiving any character at all resumes suspendedoutput; the resuming character is not discarded unless it is the STARTcharacter.  @code{IXOFF} is set, the system may also transmit STARTcharacters to the terminal.The usual value for the START character is @kbd{C-q}.  You may not beable to change this value---the hardware may insist on using @kbd{C-q}regardless of what you specify.@end deftypevr@comment termios.h@comment POSIX.1@deftypevr Macro int VSTOP@cindex STOP characterThis is the subscript for the STOP character in the special controlcharacter array.  @code{@var{termios}.c_cc[VSTOP]} holds the characteritself.The STOP character is used to support the @code{IXON} and @code{IXOFF}input modes.  If @code{IXON} is set, receiving a STOP character causesoutput to be suspended; the STOP character itself is discarded.  If@code{IXOFF} is set, the system may also transmit STOP characters to theterminal, to prevent the input queue from overflowing.The usual value for the STOP character is @kbd{C-s}.  You may not beable to change this value---the hardware may insist on using @kbd{C-s}regardless of what you specify.@end deftypevr@node Other Special@subsubsection Other Special CharactersThese special characters exist only in BSD systems and the GNU system.@comment termios.h@comment BSD@deftypevr Macro int VLNEXT@cindex LNEXT characterThis is the subscript for the LNEXT character in the special controlcharacter array.  @code{@var{termios}.c_cc[VLNEXT]} holds the characteritself.The LNEXT character is recognized only when @code{IEXTEN} is set, but inboth canonical and noncanonical mode.  It disables any special

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -