Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | :mod:`tty` --- Terminal control functions |
| 2 | ========================================= |
| 3 | |
| 4 | .. module:: tty |
| 5 | :platform: Unix |
| 6 | :synopsis: Utility functions that perform common terminal control operations. |
Terry Jan Reedy | fa089b9 | 2016-06-11 15:02:54 -0400 | [diff] [blame] | 7 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 8 | .. moduleauthor:: Steen Lumholt |
| 9 | .. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il> |
| 10 | |
Terry Jan Reedy | fa089b9 | 2016-06-11 15:02:54 -0400 | [diff] [blame] | 11 | **Source code:** :source:`Lib/tty.py` |
| 12 | |
| 13 | -------------- |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 14 | |
| 15 | The :mod:`tty` module defines functions for putting the tty into cbreak and raw |
| 16 | modes. |
| 17 | |
| 18 | Because it requires the :mod:`termios` module, it will work only on Unix. |
| 19 | |
| 20 | The :mod:`tty` module defines the following functions: |
| 21 | |
| 22 | |
Georg Brandl | 7f01a13 | 2009-09-16 15:58:14 +0000 | [diff] [blame] | 23 | .. function:: setraw(fd, when=termios.TCSAFLUSH) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 24 | |
| 25 | Change the mode of the file descriptor *fd* to raw. If *when* is omitted, it |
| 26 | defaults to :const:`termios.TCSAFLUSH`, and is passed to |
| 27 | :func:`termios.tcsetattr`. |
| 28 | |
| 29 | |
Georg Brandl | 7f01a13 | 2009-09-16 15:58:14 +0000 | [diff] [blame] | 30 | .. function:: setcbreak(fd, when=termios.TCSAFLUSH) |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 31 | |
| 32 | Change the mode of file descriptor *fd* to cbreak. If *when* is omitted, it |
| 33 | defaults to :const:`termios.TCSAFLUSH`, and is passed to |
| 34 | :func:`termios.tcsetattr`. |
| 35 | |
| 36 | |
| 37 | .. seealso:: |
| 38 | |
| 39 | Module :mod:`termios` |
| 40 | Low-level terminal control interface. |
| 41 | |