stty — Set or display terminal options
Format
stty [–ag] [operand]
Description
stty sets or reports the terminal I/O characteristics for the standard input device. stty, entered without options or operands, reports only the terminal I/O characteristics that differ from the defaults. stty, entered with operands enables, disables, or selects the full range of terminal I/O characteristics.
The stty command affects whichever line discipline is in effect for your terminal.
Options
- –a
- Displays all of the terminal I/O characteristics.
- –g
- Displays all of the terminal I/O characteristics in a format that can be used as input to the stty command.
The –a option gives you a clear readable description, whereas the –g option enables you to save and restore the terminal I/O characteristics.
stty entered with operands enables, disables, or selects the full range of terminal I/O characteristics.
Control mode operands
- parenb
- Enable parity generation and detection. Not valid for z/OS line discipline. –parenb is always used. See Usage notes.
- –parenb
- Disable parity generation and detection.
- parodd
- Select odd parity. Not valid for z/OS line discipline. –parodd is always used. See Usage notes.
- –parodd
- Select even parity.
- cs5
- Select character size CS5. Not valid for z/OS line discipline. CS8 is always used. See Usage notes.
- cs6
- Select character size CS6. Not valid for z/OS line discipline. CS8 is always used. See Usage notes.
- cs7
- Select character size CS7. Not valid for z/OS line discipline. CS8 is always used. See Usage notes.
- cs8
- Select character size CS8.
- number
- Set the input and output baud rates to number. A number of zero hangs up the modem line.
- ispeed number
- Set the input baud rate to number. Not valid for z/OS line discipline. No special processing of zero is done. See Usage notes.
- ospeed number
- Set the output baud rate to number. Not valid for z/OS line discipline. No special processing of zero is done. See Usage notes.
- hupcl
- Hang up the modem line on the last close.
- –hupcl
- Do not hang up the modem line on the last close.
- hup
- Hang up the modem line on the last close.
- –hup
- Do not hang up the modem line on the last close.
- cstopb
- Use two stop bits per character. Not valid for z/OS line discipline. –cstopb is always used. See Usage notes.
- –cstopb
- Use one stop bit per character.
- cread
- Enable the receiver.
- –cread
- Disable the receiver. Not valid for z/OS line discipline. cread is always used. See Usage notes.
- clocal
- Assume a line without modem control.
- –clocal
- Assume a line with modem control.
- columns number
- Set number of columns to number.
This should only be used if rlogin or telnet client does not support window size, or you are having trouble getting the correct size.
- row number
- Set number of rows to number.
This should only be used if rlogin or telnet client does not support window size, or you are having trouble getting the correct screen size.
Input mode operands
- ignbrk
- Ignore break on input.
- –ignbrk
- Do not ignore break on input.
- brkint
- Signal INTR on break.
- –brkint
- Do not signal INTR on break.
- ignpar
- Ignore parity errors.
- –ignpar
- Do not ignore parity errors.
- parmrk
- Mark parity errors.
- –parmrk
- Do not mark parity errors.
- inpck
- Enable input parity checking.
- –inpck
- Disable input parity checking.
- istrip
- Strip input characters to seven bits. This feature is required by the standards but IBM® strongly recomments that you not use this setting. It will make it impossible to send EBCDIC alphanumeric characters to your shell session and you will have to take extreme measures to terminate the session.
- –istrip
- Do not strip input characters to seven bits. This is the default and should not be changed.
- inlcr
- Map newline to carriage return on input.
- –inlcr
- Do not map newline to carriage return on input.
- igncr
- Ignore carriage return on input.
- –igncr
- Do not ignore carriage return on input.
- icrnl
- Map carriage return to newline on input.
- –icrnl
- Do not map carriage return to newline on input.
- iuclc
- Map uppercase alphabetic characters to lowercase on input.
- –iuclc
- Do not map uppercase alphabetic characters to lowercase on input.
- ixon
- Enable START/STOP output control.
- –ixon
- Disable START/STOP output control.
- ixany
- Allow any character to restart input.
- –ixany
- Do not allow any character to restart input.
- ixoff
- Ask the system to send START/STOP characters to regulate the size of the input queue.
- –ixoff
- Ask the system not to send START/STOP characters to regulate the size of the input queue.
Output mode operands
- onlcr
- Converts newline characters to newline-carriage return sequences.
- –onlcr
- Newline characters are displayed as newlines only.
- opost
- Postprocess output.
- –opost
- Do not postprocess output. Ignore all other output modes.
- olcuc
- Map lowercase alphabetic characters to uppercase on output.
- –olcuc
- Do not map lowercase alphabetic characters to uppercase on output.
- ocrnl
- Map CR to NL on output.
- –ocrnl
- Do not map CR to NL on output.
- onocr
- Do not output CR at column 0.
- –onocr
- Output CR at column 0.
- onlret
- The terminal newline key performs the CR function.
- –onlret
- The terminal newline key does not perform the CR function.
- ofill
- Use fill characters for delays.
- –ofill
- Use timing for delays.
- ofdel
- Fill characters are DELs.
- –ofdel
- Fill characters are NULs.
- cr0
- Sets the style of delay for CRs (CRDLY) to CR0.
- cr1
- Sets the style of delay for CRs (CRDLY) to CR1.
- cr2
- Sets the style of delay for CRs (CRDLY) to CR2.
- cr3
- Sets the style of delay for CRs (CRDLY) to CR3.
- nl0
- Select the style of delay for NL (NDLY) to NL0.
- nl1
- Select the style of delay for NL (NLDLY) to NL1.
- tab0
- Sets the style of delay for horizontal tabs (TABDLY) to TAB0.
- tab1
- Sets the style of delay for horizontal tabs (TABDLY) to TAB1.
- tab2
- Sets the style of delay for horizontal tabs (TABDLY) to TAB2.
- tab3
- Sets the style of delay for horizontal tabs (TABDLY) to TAB3.
- bs0
- Select the style of delay for backspace (BSDLY) to BS0.
- bs1
- Select the style of delay for backspace (BSDLY) to BS1.
- ff0
- Select the style of delay for form feeds (FFDLY) to FF0.
- ff1
- Select the style of delay for form feeds (FFDLY) to FF1.
- vt0
- Select the style of delay for vertical tabs (VTDLY) to VT0.
- vt1
- Select the style of delay for vertical tabs (VTDLY) to VT1.
Local mode operands
- isig
- Enable character checking against the special control characters INTR, QUIT and SUSP.
- –isig
- Disable character checking against the special control characters INTR, QUIT and SUSP.
- icanon
- Enable canonical input mode.
- –icanon
- Disable canonical input mode.
- xcase
- Set canonical uppercase or lowercase presentation.
- –xcase
- Do not set canonical uppercase or lowercase presentation.
- iexten
- Enable any custom special control characters.
- –iexten
- Disable any custom special control characters.
- echo
- Echo every character typed.
- –echo
- Do not echo every character typed.
- echoe
- Enable the ERASE character to visibly erase the latest character.
- –echoe
- Do not enable the ERASE character to visibly erase the latest character.
- echok
- Echo newline after a KILL character.
- –echok
- Do not echo newline after a KILL character.
- echonl
- Echo newline (even when echo is disabled).
- –echonl
- Do not echo newline when echo is disabled.
- noflsh
- Disable flush after INTR, QUIT, and SUSP.
- –noflsh
- Enable flush after INTR, QUIT, and SUSP.
- tostop
- Send the SIGTOU signal for background output.
- –tostop
- Do not send the SIGTOU signal for background output.
Control character operands
In a double-byte environment, the char parameter to these operands must be a narrow (singlebyte) character.
- min number
- Set min to number.
- time number
- Set time to number.
- eof char
- Set end of file character to char.
- eol char
- Set end of line character to char.
- erase char
- Set ERASE character to char.
- intr char
- Set INTR character to char.
- kill char
- Set KILL character to char.
- quit char
- Set QUIT character to char.
- susp char
- Set SUSP character to char.
- start char
- Set START character to char.
- stop char
- Set STOP character to char.
Combination mode operands
- saved-settings
- Set the terminal I/O characteristics to the saved settings produced by the –g option.
- evenp
- Enable parenb and cs7; disable parodd. Not valid for z/OS line discipline. See Usage notes.
- parity
- Enable parenb and cs7; disable parodd. Not valid for z/OS line discipline. See Usage notes.
- oddp
- Enable parenb, cs7 and parodd. Not valid for z/OS line discipline. See Usage notes.
- –parity
- Disable parenb and set cs8. Not valid for z/OS line discipline. See Usage notes.
- –evenp
- Disable parenb and set cs8. Not valid for z/OS line discipline. See Usage notes.
- –oddp
- Disable parenb and set cs8. Not valid for z/OS line discipline. See Usage notes.
- raw
- Enable raw input and output.
- –raw or cooked
- Disable raw input and output.
- nl
- Enable icrnl.
- –nl
- Disable icrnl; unset inlcr and igncr.
- lcase
- Set xcase, iuclc, and olcuc.
- –lcase
- Disable xcase, iuclc, and olcuc.
- LCASE
- Equivalent to lcase.
- –LCASE
- Equivalent to –lcase.
- tabs
- Perserve tabs when printing.
- –tabs or tab8
- Expand to spaces when printing.
- ek
- Reset ERASE and KILL characters to system defaults.
- sane
- Reset all modes to reasonable values.
Usage notes
- stty will operate successfully even if it is unable to perform one or more actions in a group of requested actions. For example, if a valid z/OS operand is requested with an invalid one, stty will operate successfully because it can perform the valid operand. The valid operand will then be satisfied.
- If stty is only used with invalid z/OS operands or invalid operands in combination with valid operands that have already been satisfied, stty will fail.
Localization
- LANG
- LC_ALL
- LC_CTYPE
- LC_MESSAGES
- LC_SYNTAX
- NLSPATH
See Localization for more information.
Exit values
- 0
- Successful completion
- 1
- Failure due to any of the following:
- Error setting termios attributes
- Unknown mode
- Missing number after option
- Argument out of range
- Bad number after option
- Internal error
- Error reading termios attributes
- Missing character after option
- Badly formed argument option character
- Missing speed after ispeed or ospeed
- Bad speed argument
Portability
POSIX.2, UNIX System V.