📄 stty.1
字号:
.\" Copyright (c) 1990, 1993, 1994.\" The Regents of the University of California. All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" the Institute of Electrical and Electronics Engineers, Inc..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)stty.1 8.4 (Berkeley) 4/18/94.\".Dd April 18, 1994.Dt STTY 1.Os.Sh NAME.Nm stty.Nd set the options for a terminal device interface.Sh SYNOPSIS.Nm stty.Op Fl a | Fl e | Fl g.Op Fl f Ar file.Op operands.Sh DESCRIPTIONThe.Nm sttyutility sets or reports on terminalcharacteristics for the device that is its standard input.If no options or operands are specified, it reports the settings of a subsetof characteristics as well as additional ones if they differ from theirdefault values.Otherwise it modifiesthe terminal state according to the specified arguments.Some combinations of arguments are mutuallyexclusive on some terminal types..PpThe following options are available:.Bl -tag -width Ds.It Fl aDisplay all the current settings for the terminal to standard outputas per.St -p1003.2 ..It Fl eDisplay all the current settings for the terminal to standard outputin the traditional.Tn BSD``all'' and ``everything'' formats..It Fl fOpen and use the terminal named by.Ar filerather than using standard input. The file is openedusing the.Dv O_NONBLOCKflag of.Fn open ,making it possible toset or display settings on a terminal that might otherwiseblock on the open..It Fl gDisplay all the current settings for the terminal to standard outputin a form that may be used as an argument to a subsequent invocation of.Nm sttyto restore the current terminal state as per.St -p1003.2 ..El.PpThe following arguments are available to set the terminalcharacteristics:.Ss Control Modes:.PpControl mode flags affect hardware characteristics associated with theterminal. This corresponds to the c_cflag in the termios structure..Bl -tag -width Fl.It Cm parenb Pq Fl parenbEnable (disable) parity generationand detection..It Cm parodd Pq Fl paroddSelect odd (even) parity..It Cm cs5 cs6 cs7 cs8Select character size, if possible..It Ar numberSet terminal baud rate to thenumber given, if possible.If thebaud rate is set to zero, modemcontrol is no longerasserted..It Cm ispeed Ar numberSet terminal input baud rate to thenumber given, if possible.If theinput baud rate is set to zero, theinput baud rate is set to thevalue of the output baudrate..It Cm ospeed Ar numberSet terminal output baud rate tothe number given, if possible.Ifthe output baud rate is set tozero, modem control isno longer asserted..It Cm speed Ar numberThis sets both.Cm ispeedand.Cm ospeedto.Ar number ..It Cm hupcl Pq Fl hupclStop asserting modem control(do not stop asserting modem control) on last close..It Cm hup Pq Fl hupSame as hupcl.Pq Fl hupcl ..It Cm cstopb Pq Fl cstopbUse two (one) stop bits per character..It Cm cread Pq Fl creadEnable (disable) the receiver..It Cm clocal Pq Fl clocalAssume a line without (with) modemcontrol..It Cm crtscts Pq Fl crtsctsEnable RTS/CTS flow control..El.Ss Input Modes:This corresponds to the c_iflag in the termios structure..Bl -tag -width Fl.It Cm ignbrk Pq Fl ignbrkIgnore (do not ignore) break oninput..It Cm brkint Pq Fl brkintSignal (do not signal).Dv INTRonbreak..It Cm ignpar Pq Fl ignparIgnore (do not ignore) parityerrors..It Cm parmrk Pq Fl parmrkMark (do not mark) parity errors..It Cm inpck Pq Fl inpckEnable (disable) input paritychecking..It Cm istrip Pq Fl istripStrip (do not strip) input charactersto seven bits..It Cm inlcr Pq Fl inlcrMap (do not map).Dv NLto.Dv CRon input..It Cm igncr Pq Fl igncrIgnore (do not ignore).Dv CRon input..It Cm icrnl Pq Fl icrnlMap (do not map).Dv CRto.Dv NLon input..It Cm ixon Pq Fl ixonEnable (disable).Dv START/STOPoutputcontrol.Output from the system isstopped when the system receives.Dv STOPand started when the systemreceives.Dv START ,or if.Cm ixanyis set, any character restarts output..It Cm ixoff Pq Fl ixoffRequest that the system send (notsend).Dv START/STOPcharacters whenthe input queue is nearlyempty/full..It Cm ixany Pq Fl ixanyAllow any character (allow only.Dv START )to restart output..It Cm imaxbel Pq Fl imaxbelThe system imposes a limit of.Dv MAX_INPUT(currently 255) characters in the input queue. If.Cm imaxbelis set and the input queue limit has been reached,subsequent input causes the system to send an ASCII BELcharacter to the output queue (the terminal beeps at you). Otherwise,if.Cm imaxbelis unset and the input queue is full, the next input character causesthe entire input and output queues to be discarded..El.Ss Output Modes:This corresponds to the c_oflag of the termios structure..Bl -tag -width Fl.It Cm opost Pq Fl opostPost-process output (do notpost-process output; ignore all otheroutput modes)..It Cm onlcr Pq Fl onlcrMap (do not map).Dv NLto.DV CR-NLon output..It Cm oxtabs Pq Fl oxtabsExpand (do not expand) tabs to spaces on output..El.Ss Local Modes:.PpLocal mode flags (lflags) affect various and sundry characteristics of terminalprocessing.Historically the term "local" pertained to new job control featuresimplemented by Jim Kulp on a.Tn Pdp 11/70at.Tn IIASA .Later the driver ran on the first.Tn VAXat Evans Hall, UC Berkeley, where the job control detailswere greatly modified but the structure definitions and namesremained essentially unchanged.The second interpretation of the 'l' in lflagis ``line discipline flag'' which corresponds to the.Ar c_lflagof the.Ar termiosstructure..Bl -tag -width Fl.It Cm isig Pq Fl isigEnable (disable) the checking ofcharacters against the special controlcharacters.Dv INTR , QUIT ,and.Dv SUSP ..It Cm icanon Pq Fl icanonEnable (disable) canonical input.Pf ( Dv ERASEand.Dv KILLprocessing)..It Cm iexten Pq Fl iextenEnable (disable) any implementationdefined special control charactersnot currently controlled by icanon,isig, or ixon..It Cm echo Pq Fl echoEcho back (do not echo back) everycharacter typed..It Cm echoe Pq Fl echoeThe.Dv ERASEcharacter shall (shallnot) visually erase the last characterin the current line from thedisplay, if possible..It Cm echok Pq Fl echokEcho (do not echo).Dv NLafter.Dv KILLcharacter..It Cm echoke Pq Fl echokeThe.Dv KILLcharacter shall (shallnot) visually erase thethe current line from thedisplay, if possible..It Cm echonl Pq Fl echonlEcho (do not echo).Dv NL ,even if echois disabled..It Cm echoctl Pq Fl echoctlIf.Cm echoctlis set, echo control characters as ^X. Otherwise control charactersecho as themselves..It Cm echoprt Pq Fl echoprtFor printing terminals. If set, echo erased characters backwards within ``\\''and ``/''. Otherwise, disable this feature..It Cm noflsh Pq Fl noflshDisable (enable) flush after.Dv INTR , QUIT , SUSP ..It Cm tostop Pq Fl tostopSend (do not send).Dv SIGTTOUfor background output. This causes background jobs to stop if they attemptterminal output..It Cm altwerase Pq Fl altweraseUse (do not use) an alternate word erase algorithm when processing.Dv WERASEcharacters.This alternate algorithm considers sequences ofalphanumeric/underscores as words.It also skips the first preceding character in its classification(as a convenience since the one preceding character could have beenerased with simply an.Dv ERASEcharacter.).It Cm mdmbuf Pq Fl mdmbufIf set, flow control output based on condition of Carrier Detect. Otherwisewrites return an error if Carrier Detect is low (and Carrier is not beingignored with the.Dv CLOCALflag.).It Cm flusho Pq Fl flushoIndicates output is (is not) being discarded..It Cm pendin Pq Fl pendinIndicates input is (is not) pending after a switch from non-canonicalto canonical mode and will be re-input when a read becomes pendingor more input arrives..El.Ss Control Characters:.Bl -tag -width Fl.It Ar control-character Ar stringSet.Ar control-characterto.Ar string .If string is a single character,the control character is set tothat character.If string is thetwo character sequence "^-" or thestring "undef" the control characteris disabled (i.e. set to.Pf { Dv _POSIX_VDISABLE Ns } . ).PpRecognized control-characters:.Bd -ragged -offset indent.Bl -column character Subscript.It control-.It character Subscript Description.It _________ _________ _______________.It eof Ta Tn VEOF EOF No character.It eol Ta Tn VEOL EOL No character.It eol2 Ta Tn VEOL2 EOL2 No character.It erase Ta Tn VERASE ERASE No character.It werase Ta Tn VWERASE WERASE No character.It intr Ta Tn VINTR INTR No character.It kill Ta Tn VKILL KILL No character.It quit Ta Tn VQUIT QUIT No character.It susp Ta Tn VSUSP SUSP No character.It start Ta Tn VSTART START No character.It stop Ta Tn VSTOP STOP No character.It dsusp Ta Tn VDSUSP DSUSP No character.It lnext Ta Tn VLNEXT LNEXT No character.It reprint Ta Tn VREPRINT REPRINT No character.It status Ta Tn VSTATUS STATUS No character.El.Ed.It Cm min Ar number.It Cm time Ar numberSet the value of min or time tonumber..Dv MINand.Dv TIMEare used inNon-Canonical mode input processing(-icanon)..El.Ss Combination Modes:.Pp.Bl -tag -width Fl.It Ar saved settingsSet the current terminalcharacteristics to the saved settingsproduced by the.Fl goption..It Cm evenp No or Cm parityEnable parenb and cs7; disableparodd..It Cm oddpEnable parenb, cs7, and parodd..It Fl parity , evenp , oddpDisable parenb, and set cs8..It Cm \&nl Pq Fl \&nlEnable (disable) icrnl.In addition-nl unsets inlcr and igncr..It Cm ekReset.Dv ERASEand.Dv KILLcharactersback to system defaults..It Cm saneResets all modes to reasonable values for interactive terminal use..It Cm ttySet the line discipline to the standard terminal line discipline.Dv TTYDISC ..It Cm crt Pq Fl crtSet (disable) all modes suitable for a CRT display device..It Cm kerninfo Pq Fl kerninfoEnable (disable) the system generated status line associated withprocessing a.Dv STATUScharacter (usually set to ^T). The status line consists of thesystem load average, the current command name, its process ID, theevent the process is waiting on (or the status of the process), the userand system times, percent cpu, and current memory usage..It Cm columns Ar numberThe terminal size is recorded as having.Ar numbercolumns..It Cm cols Ar numberis an alias for.Cm columns..It Cm rows Ar numberThe terminal size is recorded as having.Ar numberrows..It Cm decSet modes suitable for users of Digital Equipment Corporation systems (.Dv ERASE ,.Dv KILL ,and.Dv INTRcharacters are set to ^?, ^U, and ^C;.Dv ixanyis disabled, and.Dv crtis enabled.).It Cm extproc Pq Fl extprocIf set, this flag indicates that some amount of terminal processing is beingperformed by either the terminal hardware or by the remote side connectedto a pty..It Cm raw Pq Fl rawIf set, change the modes of the terminal so that no input or output processingis performed. If unset, change the modes of the terminal to some reasonablestate that performs input and output processing. Note that since theterminal driver no longer has a single.Dv RAWbit, it is not possible to intuit what flags were set prior to setting.Cm raw .This means that unsetting.Cm rawmay not put back all the setting that were previously in effect.To set the terminal into a raw state and then accurately restore it, the followingshell code is recommended:.nfsave_state=$(stty -g)stty raw\&...stty "$save_state".fi.It Cm sizeThe size of the terminal is printed as two numbers on a single line,first rows, then columns..El.Ss Compatibility Modes:.PpThese modes remain for compatibility with the previous version ofthe stty command..Bl -tag -width Fl.It Cm allReports all the terminal modes as with.Cm stty Fl aexcept that the control characters are printed in a columnar format..It Cm everythingSame as.Cm all ..It Cm cookedSame as.Cm sane ..It Cm cbreakIf set, enables.Cm brkint , ixon , imaxbel , opost ,.Cm isig , iexten ,and.Cm Fl icanon .If unset, same as.Cm sane ..It Cm newSame as.Cm tty ..It Cm oldSame as.Cm tty ..It Cm newcrt Pq Fl newcrtSame as.Cm crt ..It Cm pass8The converse of.Cm parity ..It Cm tandem Pq Fl tandemSame as.Cm ixoff ..It Cm decctlq Pq Fl decctlqThe converse of.Cm ixany ..It Cm crterase Pq Fl crteraseSame as.Cm echoe ..It Cm crtbs Pq Fl crtbsSame as.Cm echoe ..It Cm crtkill Pq Fl crtkillSame as.Cm echoke ..It Cm ctlecho Pq Fl ctlechoSame as.Cm echoctl ..It Cm prterase Pq Fl prteraseSame as.Cm echoprt ..It Cm litout Pq Fl litoutThe converse of.Cm opost ..It Cm tabs Pq Fl tabsThe converse of.Cm tabs ..It Cm brk Ar valueSame as the control character.Cm eol ..It Cm flush Ar valueSame as the control character.Cm discard ..It Cm rprnt Ar valueSame as the control character.Cm reprint ..El.PpThe.Nm sttyutility exits with a value of 0 if successful, and >0 if an error occurs..Sh SEE ALSO.Xr termios 4.Sh STANDARDSThe.Nm sttyfunction is expected to be.St -p1003.2compatible. The flags.Fl eand.Fl fareextensions to the standard.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -