Put terminal into raw mode.
(fd, when=TCSAFLUSH)
| 57 | mode[CC][VTIME] = 0 |
| 58 | |
| 59 | def setraw(fd, when=TCSAFLUSH): |
| 60 | """Put terminal into raw mode.""" |
| 61 | mode = tcgetattr(fd) |
| 62 | new = list(mode) |
| 63 | cfmakeraw(new) |
| 64 | tcsetattr(fd, when, new) |
| 65 | return mode |
| 66 | |
| 67 | def setcbreak(fd, when=TCSAFLUSH): |
| 68 | """Put terminal into cbreak mode.""" |