logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

stty.1p (27835B)


  1. '\" et
  2. .TH STTY "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. stty
  12. \(em set the options for a terminal
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. stty \fB[\fR-a|-g\fB]\fR
  17. .P
  18. stty \fIoperand\fR...
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. .IR stty
  23. utility shall set or report on terminal I/O characteristics for the
  24. device that is its standard input. Without options or operands
  25. specified, it shall report the settings of certain characteristics,
  26. usually those that differ from implementation-defined defaults.
  27. Otherwise, it shall modify the terminal state according to the
  28. specified operands. Detailed information about the modes listed in the
  29. first five groups below are described in the Base Definitions volume of POSIX.1\(hy2017,
  30. .IR "Chapter 11" ", " "General Terminal Interface".
  31. Operands in the Combination Modes group (see
  32. .IR "Combination Modes")
  33. are implemented using operands in the previous groups. Some
  34. combinations of operands are mutually-exclusive on some terminal types;
  35. the results of using such combinations are unspecified.
  36. .P
  37. Typical implementations of this utility require a communications line
  38. configured to use the
  39. .BR termios
  40. interface defined in the System Interfaces volume of POSIX.1\(hy2017. On systems where none of these lines
  41. are available, and on lines not currently configured to support the
  42. .BR termios
  43. interface, some of the operands need not affect terminal
  44. characteristics.
  45. .SH OPTIONS
  46. The
  47. .IR stty
  48. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  49. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  50. .P
  51. The following options shall be supported:
  52. .IP "\fB\-a\fP" 10
  53. Write to standard output all the current settings for the terminal.
  54. .IP "\fB\-g\fP" 10
  55. Write to standard output all the current settings in an unspecified
  56. form that can be used as arguments to another invocation of the
  57. .IR stty
  58. utility on the same system. The form used shall not contain any
  59. characters that would require quoting to avoid word expansion by the
  60. shell; see
  61. .IR "Section 2.6" ", " "Word Expansions".
  62. .SH OPERANDS
  63. The following operands shall be supported to set the terminal
  64. characteristics.
  65. .SS "Control Modes"
  66. .IP "\fBparenb\ \fR(\fB\-parenb\fR)" 12
  67. Enable (disable) parity generation and detection. This shall have
  68. the effect of setting (not setting) PARENB in the
  69. .BR termios
  70. .IR c_cflag
  71. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  72. .IR "Chapter 11" ", " "General Terminal Interface".
  73. .IP "\fBparodd\ \fR(\fB\-parodd\fR)" 12
  74. .br
  75. Select odd (even) parity. This shall have the effect of setting (not
  76. setting) PARODD in the
  77. .BR termios
  78. .IR c_cflag
  79. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  80. .IR "Chapter 11" ", " "General Terminal Interface".
  81. .IP "\fBcs5\ cs6\ cs7\ cs8\fR" 12
  82. Select character size, if possible. This shall have the effect of
  83. setting CS5, CS6, CS7, and CS8, respectively, in the
  84. .BR termios
  85. .IR c_cflag
  86. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  87. .IR "Chapter 11" ", " "General Terminal Interface".
  88. .IP "\fInumber\fR" 12
  89. Set terminal baud rate to the number given, if possible. If the baud
  90. rate is set to zero, the modem control lines shall no longer be
  91. asserted. This shall have the effect of setting the input and output
  92. .BR termios
  93. baud rate values as defined in the Base Definitions volume of POSIX.1\(hy2017,
  94. .IR "Chapter 11" ", " "General Terminal Interface".
  95. .IP "\fBispeed\ \fInumber\fR" 12
  96. Set terminal input baud rate to the number given, if possible. If the
  97. input baud rate is set to zero, the input baud rate shall be specified
  98. by the value of the output baud rate. This shall have the effect of
  99. setting the input
  100. .BR termios
  101. baud rate values as defined in the Base Definitions volume of POSIX.1\(hy2017,
  102. .IR "Chapter 11" ", " "General Terminal Interface".
  103. .IP "\fBospeed\ \fInumber\fR" 12
  104. Set terminal output baud rate to the number given, if possible. If the
  105. output baud rate is set to zero, the modem control lines shall no
  106. longer be asserted. This shall have the effect of setting the output
  107. .BR termios
  108. baud rate values as defined in the Base Definitions volume of POSIX.1\(hy2017,
  109. .IR "Chapter 11" ", " "General Terminal Interface".
  110. .IP "\fBhupcl\ \fR(\fB\-hupcl\fR)" 12
  111. Stop asserting modem control lines (do not stop asserting modem control
  112. lines) on last close. This shall have the effect of setting (not
  113. setting) HUPCL in the
  114. .BR termios
  115. .IR c_cflag
  116. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  117. .IR "Chapter 11" ", " "General Terminal Interface".
  118. .IP "\fBhup\ \fR(\fB\-hup\fR)" 12
  119. Equivalent to
  120. .BR hupcl (\c
  121. .BR \-hupcl ).
  122. .IP "\fBcstopb\ \fR(\fB\-cstopb\fR)" 12
  123. Use two (one) stop bits per character. This shall have the effect of
  124. setting (not setting) CSTOPB in the
  125. .BR termios
  126. .IR c_cflag
  127. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  128. .IR "Chapter 11" ", " "General Terminal Interface".
  129. .IP "\fBcread\ \fR(\fB\-cread\fR)" 12
  130. Enable (disable) the receiver. This shall have the effect of setting
  131. (not setting) CREAD in the
  132. .BR termios
  133. .IR c_cflag
  134. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  135. .IR "Chapter 11" ", " "General Terminal Interface".
  136. .IP "\fBclocal\ \fR(\fB\-clocal\fR)" 12
  137. Assume a line without (with) modem control. This shall have the effect
  138. of setting (not setting) CLOCAL in the
  139. .BR termios
  140. .IR c_cflag
  141. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  142. .IR "Chapter 11" ", " "General Terminal Interface".
  143. .P
  144. It is unspecified whether
  145. .IR stty
  146. shall report an error if an attempt to set a Control Mode fails.
  147. .SS "Input Modes"
  148. .IP "\fBignbrk\ \fR(\fB\-ignbrk\fR)" 12
  149. Ignore (do not ignore) break on input. This shall have the effect of
  150. setting (not setting) IGNBRK in the
  151. .BR termios
  152. .IR c_iflag
  153. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  154. .IR "Chapter 11" ", " "General Terminal Interface".
  155. .IP "\fBbrkint\ \fR(\fB\-brkint\fR)" 12
  156. Signal (do not signal) INTR on break. This shall have the effect of
  157. setting (not setting) BRKINT in the
  158. .BR termios
  159. .IR c_iflag
  160. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  161. .IR "Chapter 11" ", " "General Terminal Interface".
  162. .IP "\fBignpar\ \fR(\fB\-ignpar\fR)" 12
  163. Ignore (do not ignore) bytes with parity errors. This shall have the
  164. effect of setting (not setting) IGNPAR in the
  165. .BR termios
  166. .IR c_iflag
  167. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  168. .IR "Chapter 11" ", " "General Terminal Interface".
  169. .IP "\fBparmrk\ \fR(\fB\-parmrk\fR)" 12
  170. .br
  171. Mark (do not mark) parity errors. This shall have the effect of
  172. setting (not setting) PARMRK in the
  173. .BR termios
  174. .IR c_iflag
  175. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  176. .IR "Chapter 11" ", " "General Terminal Interface".
  177. .IP "\fBinpck\ \fR(\fB\-inpck\fR)" 12
  178. Enable (disable) input parity checking. This shall have the effect of
  179. setting (not setting) INPCK in the
  180. .BR termios
  181. .IR c_iflag
  182. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  183. .IR "Chapter 11" ", " "General Terminal Interface".
  184. .IP "\fBistrip\ \fR(\fB\-istrip\fR)" 12
  185. Strip (do not strip) input characters to seven bits. This shall have
  186. the effect of setting (not setting) ISTRIP in the
  187. .BR termios
  188. .IR c_iflag
  189. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  190. .IR "Chapter 11" ", " "General Terminal Interface".
  191. .IP "\fBinlcr\ \fR(\fB\-inlcr\fR)" 12
  192. Map (do not map) NL to CR on input. This shall have the effect of
  193. setting (not setting) INLCR in the
  194. .BR termios
  195. .IR c_iflag
  196. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  197. .IR "Chapter 11" ", " "General Terminal Interface".
  198. .IP "\fBigncr\ (\-igncr)\fR" 12
  199. Ignore (do not ignore) CR on input. This shall have the effect of
  200. setting (not setting) IGNCR in the
  201. .BR termios
  202. .IR c_iflag
  203. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  204. .IR "Chapter 11" ", " "General Terminal Interface".
  205. .IP "\fBicrnl\ \fR(\fB\-icrnl\fR)" 12
  206. Map (do not map) CR to NL on input. This shall have the effect of
  207. setting (not setting) ICRNL in the
  208. .BR termios
  209. .IR c_iflag
  210. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  211. .IR "Chapter 11" ", " "General Terminal Interface".
  212. .IP "\fBixon\ \fR(\fB\-ixon\fR)" 12
  213. Enable (disable) START/STOP output control. Output from the system is
  214. stopped when the system receives STOP and started when the system
  215. receives START. This shall have the effect of setting (not setting)
  216. IXON in the
  217. .BR termios
  218. .IR c_iflag
  219. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  220. .IR "Chapter 11" ", " "General Terminal Interface".
  221. .IP "\fBixany\ \fR(\fB\-ixany\fR)" 12
  222. Allow any character to restart output. This shall have the effect of
  223. setting (not setting) IXANY in the
  224. .BR termios
  225. .IR c_iflag
  226. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  227. .IR "Chapter 11" ", " "General Terminal Interface".
  228. .IP "\fBixoff\ \fR(\fB\-ixoff\fR)" 12
  229. Request that the system send (not send) STOP characters when the input
  230. queue is nearly full and START characters to resume data transmission.
  231. This shall have the effect of setting (not setting) IXOFF in the
  232. .BR termios
  233. .IR c_iflag
  234. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  235. .IR "Chapter 11" ", " "General Terminal Interface".
  236. .SS "Output Modes"
  237. .IP "\fBopost\ \fR(\fB\-opost\fR)" 12
  238. Post-process output (do not post-process output; ignore all other
  239. output modes). This shall have the effect of setting (not setting)
  240. OPOST in the
  241. .BR termios
  242. .IR c_oflag
  243. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  244. .IR "Chapter 11" ", " "General Terminal Interface".
  245. .IP "\fBonlcr\ \fR(\fB\-onlcr\fR)" 12
  246. Map (do not map) NL to CR-NL on output. This shall have the effect of
  247. setting (not setting) ONLCR in the
  248. .BR termios
  249. .IR c_oflag
  250. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  251. .IR "Chapter 11" ", " "General Terminal Interface".
  252. .IP "\fBocrnl\ \fR(\fB\-ocrnl\fR)" 12
  253. Map (do not map) CR to NL on output. This shall have the effect of
  254. setting (not setting) OCRNL in the
  255. .BR termios
  256. .IR c_oflag
  257. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  258. .IR "Chapter 11" ", " "General Terminal Interface".
  259. .IP "\fBonocr\ \fR(\fB\-onocr\fR)" 12
  260. Do not (do) output CR at column zero. This shall have the effect of
  261. setting (not setting) ONOCR in the
  262. .BR termios
  263. .IR c_oflag
  264. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  265. .IR "Chapter 11" ", " "General Terminal Interface".
  266. .IP "\fBonlret\ \fR(\fB\-onlret\fR)" 12
  267. The terminal newline key performs (does not perform) the CR function.
  268. This shall have the effect of setting (not setting) ONLRET in the
  269. .BR termios
  270. .IR c_oflag
  271. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  272. .IR "Chapter 11" ", " "General Terminal Interface".
  273. .IP "\fBofill\ \fR(\fB\-ofill\fR)" 12
  274. Use fill characters (use timing) for delays. This shall have the
  275. effect of setting (not setting) OFILL in the
  276. .BR termios
  277. .IR c_oflag
  278. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  279. .IR "Chapter 11" ", " "General Terminal Interface".
  280. .IP "\fBofdel\ \fR(\fB\-ofdel\fR)" 12
  281. Fill characters are DELs (NULs). This shall have the effect of setting
  282. (not setting) OFDEL in the
  283. .BR termios
  284. .IR c_oflag
  285. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  286. .IR "Chapter 11" ", " "General Terminal Interface".
  287. .IP "\fBcr0\ cr1\ cr2\ cr3\fR" 12
  288. Select the style of delay for CRs. This shall have the effect of
  289. setting CRDLY to CR0, CR1, CR2, or CR3, respectively, in the
  290. .BR termios
  291. .IR c_oflag
  292. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  293. .IR "Chapter 11" ", " "General Terminal Interface".
  294. .IP "\fBnl0\ nl1\fR" 12
  295. Select the style of delay for NL. This shall have the effect of
  296. setting NLDLY to NL0 or NL1, respectively, in the
  297. .BR termios
  298. .IR c_oflag
  299. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  300. .IR "Chapter 11" ", " "General Terminal Interface".
  301. .IP "\fBtab0\ tab1\ tab2\ tab3\fR" 12
  302. .br
  303. Select the style of delay for horizontal tabs. This shall have the
  304. effect of setting TABDLY to TAB0, TAB1, TAB2, or TAB3, respectively,
  305. in the
  306. .BR termios
  307. .IR c_oflag
  308. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  309. .IR "Chapter 11" ", " "General Terminal Interface".
  310. Note that TAB3 has the effect of expanding
  311. <tab>
  312. characters to
  313. <space>
  314. characters.
  315. .IP "\fBtabs\ \fR(\fB\-tabs\fR)" 12
  316. Synonym for
  317. .BR tab0
  318. (\c
  319. .BR tab3 ).
  320. .IP "\fBbs0\ bs1\fR" 12
  321. Select the style of delay for
  322. <backspace>
  323. characters. This shall have the effect of setting BSDLY to BS0 or BS1,
  324. respectively, in the
  325. .BR termios
  326. .IR c_oflag
  327. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  328. .IR "Chapter 11" ", " "General Terminal Interface".
  329. .IP "\fBff0\ ff1\fR" 12
  330. Select the style of delay for
  331. <form-feed>
  332. characters. This shall have the effect of setting FFDLY to FF0 or FF1,
  333. respectively, in the
  334. .BR termios
  335. .IR c_oflag
  336. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  337. .IR "Chapter 11" ", " "General Terminal Interface".
  338. .IP "\fBvt0\ vt1\fR" 12
  339. Select the style of delay for
  340. <vertical-tab>
  341. characters. This shall have the effect of setting VTDLY to VT0 or VT1,
  342. respectively, in the
  343. .BR termios
  344. .IR c_oflag
  345. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  346. .IR "Chapter 11" ", " "General Terminal Interface".
  347. .SS "Local Modes"
  348. .IP "\fBisig\ \fR(\fB\-isig\fR)" 12
  349. Enable (disable) the checking of characters against the special control
  350. characters INTR, QUIT, and SUSP. This shall have the effect of setting
  351. (not setting) ISIG in the
  352. .BR termios
  353. .IR c_lflag
  354. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  355. .IR "Chapter 11" ", " "General Terminal Interface".
  356. .IP "\fBicanon\ \fR(\fB\-icanon\fR)" 12
  357. Enable (disable) canonical input (ERASE and KILL processing). This
  358. shall have the effect of setting (not setting) ICANON in the
  359. .BR termios
  360. .IR c_lflag
  361. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  362. .IR "Chapter 11" ", " "General Terminal Interface".
  363. .IP "\fBiexten\ \fR(\fB\-iexten\fR)" 12
  364. Enable (disable) any implementation-defined special control
  365. characters not currently controlled by
  366. .BR icanon ,
  367. .BR isig ,
  368. .BR ixon ,
  369. or
  370. .BR ixoff .
  371. This shall have the effect of setting (not setting) IEXTEN in the
  372. .BR termios
  373. .IR c_lflag
  374. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  375. .IR "Chapter 11" ", " "General Terminal Interface".
  376. .IP "\fBecho\ \fR(\fB\-echo\fR)" 12
  377. Echo back (do not echo back) every character typed. This shall have
  378. the effect of setting (not setting) ECHO in the
  379. .BR termios
  380. .IR c_lflag
  381. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  382. .IR "Chapter 11" ", " "General Terminal Interface".
  383. .IP "\fBechoe\ \fR(\fB\-echoe\fR)" 12
  384. The ERASE character visually erases (does not erase) the last character
  385. in the current line from the display, if possible. This shall have the
  386. effect of setting (not setting) ECHOE in the
  387. .BR termios
  388. .IR c_lflag
  389. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  390. .IR "Chapter 11" ", " "General Terminal Interface".
  391. .IP "\fBechok\ \fR(\fB\-echok\fR)" 12
  392. Echo (do not echo) NL after KILL character. This shall have the effect
  393. of setting (not setting) ECHOK in the
  394. .BR termios
  395. .IR c_lflag
  396. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  397. .IR "Chapter 11" ", " "General Terminal Interface".
  398. .IP "\fBechonl\ \fR(\fB\-echonl\fR)" 12
  399. Echo (do not echo) NL, even if
  400. .BR echo
  401. is disabled. This shall have the effect of setting (not setting)
  402. ECHONL in the
  403. .BR termios
  404. .IR c_lflag
  405. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  406. .IR "Chapter 11" ", " "General Terminal Interface".
  407. .IP "\fBnoflsh\ \fR(\fB\-noflsh\fR)" 12
  408. Disable (enable) flush after INTR, QUIT, SUSP. This shall have the
  409. effect of setting (not setting) NOFLSH in the
  410. .BR termios
  411. .IR c_lflag
  412. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  413. .IR "Chapter 11" ", " "General Terminal Interface".
  414. .IP "\fBtostop\ \fR(\fB\-tostop\fR)" 12
  415. Send SIGTTOU for background output. This shall have the effect of
  416. setting (not setting) TOSTOP in the
  417. .BR termios
  418. .IR c_lflag
  419. field, as defined in the Base Definitions volume of POSIX.1\(hy2017,
  420. .IR "Chapter 11" ", " "General Terminal Interface".
  421. .SS "Special Control Character Assignments"
  422. .IP "<\fIcontrol\fR>\(hy\fIcharacter\ string\fR" 6
  423. .br
  424. Set <\fIcontrol\fP>\(hy\fIcharacter\fR to
  425. .IR string .
  426. If <\fIcontrol\fP>\(hy\fIcharacter\fR is one of the character sequences
  427. in the first column of the following table, the corresponding the Base Definitions volume of POSIX.1\(hy2017,
  428. .IR "Chapter 11" ", " "General Terminal Interface"
  429. control character from the second column shall be recognized. This has
  430. the effect of setting the corresponding element of the
  431. .BR termios
  432. .IR c_cc
  433. array (see the Base Definitions volume of POSIX.1\(hy2017,
  434. .IR "Chapter 13" ", " "Headers",
  435. .IR <termios.h> ).
  436. .br
  437. .sp
  438. .ce 1
  439. \fBTable: Control Character Names in \fIstty\fP\fR
  440. .TS
  441. center tab(@) box;
  442. cB | cB | cB
  443. lB | l | l.
  444. Control Character@c_cc Subscript@Description
  445. _
  446. eof@VEOF@EOF character
  447. eol@VEOL@EOL character
  448. erase@VERASE@ERASE character
  449. intr@VINTR@INTR character
  450. kill@VKILL@KILL character
  451. quit@VQUIT@QUIT character
  452. susp@VSUSP@SUSP character
  453. start@VSTART@START character
  454. stop@VSTOP@STOP character
  455. .TE
  456. .RS 6
  457. .P
  458. If
  459. .IR string
  460. is a single character, the control character shall be set to that
  461. character. If
  462. .IR string
  463. is the two-character sequence
  464. .BR \(dq\(ha-\(dq
  465. or the string
  466. .IR undef ,
  467. the control character shall be set to _POSIX_VDISABLE , if it is in
  468. effect for the device; if _POSIX_VDISABLE is not in effect for the
  469. device, it shall be treated as an error. In the POSIX locale, if
  470. .IR string
  471. is a two-character sequence beginning with
  472. <circumflex>
  473. (\c
  474. .BR '\(ha' ),
  475. and the second character is one of those listed in the
  476. .BR \(dq\(hac\(dq
  477. column of the following table, the control character shall be set to
  478. the corresponding character value in the Value column of the table.
  479. .br
  480. .sp
  481. .ce 1
  482. \fBTable: Circumflex Control Characters in \fIstty\fP\fR
  483. .TS
  484. center tab(@) box;
  485. cB cB | cB cB | cB cB
  486. lf5 2 l 6 | lf5 2 l 6 | lf5 2 l.
  487. \&^c@Value@^c@Value@^c@Value
  488. _
  489. a\fR,\fP A@<SOH>@l\fR,\fP L@<FF>@w\fR,\fP W@<ETB>
  490. b\fR,\fP B@<STX>@m\fR,\fP M@<CR>@x\fR,\fP X@<CAN>
  491. c\fR,\fP C@<ETX>@n\fR,\fP N@<SO>@y\fR,\fP Y@<EM>
  492. d\fR,\fP D@<EOT>@o\fR,\fP O@<SI>@z\fR,\fP Z@<SUB>
  493. e\fR,\fP E@<ENQ>@p\fR,\fP P@<DLE>@[@<ESC>
  494. f\fR,\fP F@<ACK>@q\fR,\fP Q@<DC1>@\e@<FS>
  495. g\fR,\fP G@<BEL>@r\fR,\fP R@<DC2>@]@<GS>
  496. h\fR,\fP H@<BS>@s\fR,\fP S@<DC3>@\&^@<RS>
  497. i\fR,\fP I@<HT>@t\fR,\fP T@<DC4>@\&_@<US>
  498. j\fR,\fP J@<LF>@u\fR,\fP U@<NAK>@?@<DEL>
  499. k\fR,\fP K@<VT>@v\fR,\fP V@<SYN>
  500. .TE
  501. .RE
  502. .IP "\fBmin\ \fInumber\fR" 6
  503. .br
  504. Set the value of MIN to
  505. .IR number .
  506. MIN is used in non-canonical mode input processing (\c
  507. .BR icanon ).
  508. .IP "\fBtime\ \fInumber\fR" 6
  509. .br
  510. Set the value of TIME to
  511. .IR number .
  512. TIME is used in non-canonical mode input processing (\c
  513. .BR icanon ).
  514. .SS "Combination Modes"
  515. .IP "\fIsaved\ settings\fR" 6
  516. .br
  517. Set the current terminal characteristics to the saved settings produced
  518. by the
  519. .BR \-g
  520. option.
  521. .IP "\fBevenp\fR\ or\ \fBparity\fR" 6
  522. .br
  523. Enable
  524. .BR parenb
  525. and
  526. .BR cs7 ;
  527. disable
  528. .BR parodd .
  529. .IP "\fBoddp\fR" 6
  530. .br
  531. Enable
  532. .BR parenb ,
  533. .BR cs7 ,
  534. and
  535. .BR parodd .
  536. .IP "\fB\-parity\fR, \fB\-evenp\fR, or \fB\-oddp\fR" 6
  537. .br
  538. Disable
  539. .BR parenb ,
  540. and set
  541. .BR cs8 .
  542. .IP "\fBraw\ \fR(\fB\-raw\fR\ or\ \fBcooked\fR)" 6
  543. .br
  544. Enable (disable) raw input and output. Raw mode shall be equivalent to
  545. setting:
  546. .RS 6
  547. .sp
  548. .RS 4
  549. .nf
  550. stty cs8 erase \(ha- kill \(ha- intr \(ha- \e
  551. quit \(ha- eof \(ha- eol \(ha- -post -inpck
  552. .fi
  553. .P
  554. .RE
  555. .RE
  556. .IP "\fBnl\ \fR(\fB\-nl\fR)" 6
  557. .br
  558. Disable (enable)
  559. .BR icrnl .
  560. In addition,
  561. .BR \-nl
  562. unsets
  563. .BR inlcr
  564. and
  565. .BR igncr .
  566. .IP "\fBek\fR" 6
  567. Reset ERASE and KILL characters back to system defaults.
  568. .IP "\fBsane\fR" 6
  569. .br
  570. Reset all modes to some reasonable, unspecified, values.
  571. .SH STDIN
  572. Although no input is read from standard input, standard input shall be
  573. used to get the current terminal I/O characteristics and to set new
  574. terminal I/O characteristics.
  575. .SH "INPUT FILES"
  576. None.
  577. .SH "ENVIRONMENT VARIABLES"
  578. The following environment variables shall affect the execution of
  579. .IR stty :
  580. .IP "\fILANG\fP" 10
  581. Provide a default value for the internationalization variables that are
  582. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  583. .IR "Section 8.2" ", " "Internationalization Variables"
  584. for the precedence of internationalization variables used to determine
  585. the values of locale categories.)
  586. .IP "\fILC_ALL\fP" 10
  587. If set to a non-empty string value, override the values of all the
  588. other internationalization variables.
  589. .IP "\fILC_CTYPE\fP" 10
  590. This variable determines the locale for the interpretation of sequences
  591. of bytes of text data as characters (for example, single-byte as
  592. opposed to multi-byte characters in arguments) and which characters are
  593. in the class
  594. .BR print .
  595. .IP "\fILC_MESSAGES\fP" 10
  596. .br
  597. Determine the locale that should be used to affect the format and
  598. contents of diagnostic messages written to standard error.
  599. .IP "\fINLSPATH\fP" 10
  600. Determine the location of message catalogs for the processing of
  601. .IR LC_MESSAGES .
  602. .SH "ASYNCHRONOUS EVENTS"
  603. Default.
  604. .SH STDOUT
  605. If operands are specified, no output shall be produced.
  606. .P
  607. If the
  608. .BR \-g
  609. option is specified,
  610. .IR stty
  611. shall write to standard output the current settings in a form that can
  612. be used as arguments to another instance of
  613. .IR stty
  614. on the same system.
  615. .P
  616. If the
  617. .BR \-a
  618. option is specified, all of the information as described in the
  619. OPERANDS section shall be written to standard output. Unless otherwise
  620. specified, this information shall be written as
  621. <space>-separated
  622. tokens in an unspecified format, on one or more lines, with an
  623. unspecified number of tokens per line. Additional information may be
  624. written.
  625. .P
  626. If no options or operands are specified, an unspecified subset of the
  627. information written for the
  628. .BR \-a
  629. option shall be written.
  630. .P
  631. If speed information is written as part of the default output, or if
  632. the
  633. .BR \-a
  634. option is specified and if the terminal input speed and output speed
  635. are the same, the speed information shall be written as follows:
  636. .sp
  637. .RS 4
  638. .nf
  639. "speed %d baud;", <\fIspeed\fR>
  640. .fi
  641. .P
  642. .RE
  643. .P
  644. Otherwise, speeds shall be written as:
  645. .sp
  646. .RS 4
  647. .nf
  648. "ispeed %d baud; ospeed %d baud;", <\fIispeed\fR>, <\fIospeed\fR>
  649. .fi
  650. .P
  651. .RE
  652. .P
  653. In locales other than the POSIX locale, the word
  654. .BR baud
  655. may be changed to something more appropriate in those locales.
  656. .P
  657. If control characters are written as part of the default output, or if
  658. the
  659. .BR \-a
  660. option is specified, control characters shall be written as:
  661. .sp
  662. .RS 4
  663. .nf
  664. "%s = %s;", <\fIcontrol-character name\fR>, <\fIvalue\fR>
  665. .fi
  666. .P
  667. .RE
  668. .P
  669. where <\fIvalue\fP> is either the character, or some visual
  670. representation of the character if it is non-printable, or the string
  671. .IR undef
  672. if the character is disabled.
  673. .SH STDERR
  674. The standard error shall be used only for diagnostic messages.
  675. .SH "OUTPUT FILES"
  676. None.
  677. .SH "EXTENDED DESCRIPTION"
  678. None.
  679. .SH "EXIT STATUS"
  680. The following exit values shall be returned:
  681. .IP "\00" 6
  682. The terminal options were read or set successfully.
  683. .IP >0 6
  684. An error occurred.
  685. .SH "CONSEQUENCES OF ERRORS"
  686. Default.
  687. .LP
  688. .IR "The following sections are informative."
  689. .SH "APPLICATION USAGE"
  690. The
  691. .BR \-g
  692. flag is designed to facilitate the saving and restoring of terminal
  693. state from the shell level. For example, a program may:
  694. .sp
  695. .RS 4
  696. .nf
  697. saveterm="$(stty -g)" # save terminal state
  698. stty \fI(new settings)\fR # set new state
  699. \&... # ...
  700. stty $saveterm # restore terminal state
  701. .fi
  702. .P
  703. .RE
  704. .P
  705. Since the format is unspecified, the saved value is not portable across
  706. systems.
  707. .P
  708. Since the
  709. .BR \-a
  710. format is so loosely specified, scripts that save and restore terminal
  711. settings should use the
  712. .BR \-g
  713. option.
  714. .SH EXAMPLES
  715. None.
  716. .SH RATIONALE
  717. The original
  718. .IR stty
  719. description was taken directly from System V and reflected the System V
  720. terminal driver
  721. .BR termio .
  722. It has been modified to correspond to the terminal driver
  723. .BR termios .
  724. .P
  725. Output modes are specified only for XSI-conformant systems. All
  726. implementations are expected to provide
  727. .IR stty
  728. operands corresponding to all of the output modes they support.
  729. .P
  730. The
  731. .IR stty
  732. utility is primarily used to tailor the user interface of the terminal,
  733. such as selecting the preferred ERASE and KILL characters. As an
  734. application programming utility,
  735. .IR stty
  736. can be used within shell scripts to alter the terminal settings for the
  737. duration of the script.
  738. .P
  739. The
  740. .BR termios
  741. section states that individual disabling of control characters is
  742. possible through the option _POSIX_VDISABLE.
  743. If enabled, two conventions currently exist for specifying this: System
  744. V uses
  745. .BR \(dq\(ha-\(dq ,
  746. and BSD uses
  747. .IR undef .
  748. Both are accepted by
  749. .IR stty
  750. in this volume of POSIX.1\(hy2017. The other BSD convention of using the letter
  751. .BR 'u'
  752. was rejected because it conflicts with the actual letter
  753. .BR 'u' ,
  754. which is an acceptable value for a control character.
  755. .P
  756. Early proposals did not specify the mapping of
  757. .BR \(dq\(hac\(dq
  758. to control characters because the control characters were not specified
  759. in the POSIX locale character set description file requirements. The
  760. control character set is now specified in the Base Definitions volume of POSIX.1\(hy2017,
  761. .IR "Chapter 3" ", " "Definitions",
  762. so the historical mapping is specified. Note that although the mapping
  763. corresponds to control-character key assignments on many terminals that
  764. use the ISO/IEC\ 646:\|1991 standard (or ASCII) character encodings, the mapping specified
  765. here is to the control characters, not their keyboard encodings.
  766. .P
  767. Since
  768. .BR termios
  769. supports separate speeds for input and output, two new options were
  770. added to specify each distinctly.
  771. .P
  772. Some historical implementations use standard input to get and set
  773. terminal characteristics; others use standard output. Since input from
  774. a login TTY is usually restricted to the owner while output to a TTY is
  775. frequently open to anyone, using standard input provides fewer chances
  776. of accidentally (or maliciously) altering the terminal settings of
  777. other users. Using standard input also allows
  778. .IR stty
  779. .BR \-a
  780. and
  781. .IR stty
  782. .BR \-g
  783. output to be redirected for later use. Therefore, usage of standard
  784. input is required by this volume of POSIX.1\(hy2017.
  785. .SH "FUTURE DIRECTIONS"
  786. None.
  787. .SH "SEE ALSO"
  788. .IR "Chapter 2" ", " "Shell Command Language"
  789. .P
  790. The Base Definitions volume of POSIX.1\(hy2017,
  791. .IR "Chapter 8" ", " "Environment Variables",
  792. .IR "Chapter 11" ", " "General Terminal Interface",
  793. .IR "Section 12.2" ", " "Utility Syntax Guidelines",
  794. .IR "\fB<termios.h>\fP"
  795. .\"
  796. .SH COPYRIGHT
  797. Portions of this text are reprinted and reproduced in electronic form
  798. from IEEE Std 1003.1-2017, Standard for Information Technology
  799. -- Portable Operating System Interface (POSIX), The Open Group Base
  800. Specifications Issue 7, 2018 Edition,
  801. Copyright (C) 2018 by the Institute of
  802. Electrical and Electronics Engineers, Inc and The Open Group.
  803. In the event of any discrepancy between this version and the original IEEE and
  804. The Open Group Standard, the original IEEE and The Open Group Standard
  805. is the referee document. The original Standard can be obtained online at
  806. http://www.opengroup.org/unix/online.html .
  807. .PP
  808. Any typographical or formatting errors that appear
  809. in this page are most likely
  810. to have been introduced during the conversion of the source files to
  811. man page format. To report such errors, see
  812. https://www.kernel.org/doc/man-pages/reporting_bugs.html .