Make termios mode cbreak.
(mode)
| 44 | mode[CC][VTIME] = 0 |
| 45 | |
| 46 | def cfmakecbreak(mode): |
| 47 | """Make termios mode cbreak.""" |
| 48 | # Do not echo characters; disable canonical input. |
| 49 | mode[LFLAG] &= ~(ECHO | ICANON) |
| 50 | |
| 51 | # POSIX.1-2017, 11.1.7 Non-Canonical Mode Input Processing, |
| 52 | # Case B: MIN>0, TIME=0 |
| 53 | # A pending read shall block until MIN (here 1) bytes are received, |
| 54 | # or a signal is received. |
| 55 | mode[CC] = list(mode[CC]) |
| 56 | mode[CC][VMIN] = 1 |
| 57 | mode[CC][VTIME] = 0 |
| 58 | |
| 59 | def setraw(fd, when=TCSAFLUSH): |
| 60 | """Put terminal into raw mode.""" |