blob: b30bc3c7ac42e9d960925ef06dad3682a429124e [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001: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 Reedyfa089b92016-06-11 15:02:54 -04007
Georg Brandl116aa622007-08-15 14:28:22 +00008.. moduleauthor:: Steen Lumholt
9.. sectionauthor:: Moshe Zadka <moshez@zadka.site.co.il>
10
Terry Jan Reedyfa089b92016-06-11 15:02:54 -040011**Source code:** :source:`Lib/tty.py`
12
13--------------
Georg Brandl116aa622007-08-15 14:28:22 +000014
15The :mod:`tty` module defines functions for putting the tty into cbreak and raw
16modes.
17
18Because it requires the :mod:`termios` module, it will work only on Unix.
19
20The :mod:`tty` module defines the following functions:
21
22
Georg Brandl7f01a132009-09-16 15:58:14 +000023.. function:: setraw(fd, when=termios.TCSAFLUSH)
Georg Brandl116aa622007-08-15 14:28:22 +000024
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 Brandl7f01a132009-09-16 15:58:14 +000030.. function:: setcbreak(fd, when=termios.TCSAFLUSH)
Georg Brandl116aa622007-08-15 14:28:22 +000031
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