MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / setraw

Function setraw

tools/python-3.11.9-amd64/Lib/tty.py:18–28  ·  view source on GitHub ↗

Put terminal into a raw mode.

(fd, when=TCSAFLUSH)

Source from the content-addressed store, hash-verified

16CC = 6
17
18def setraw(fd, when=TCSAFLUSH):
19 """Put terminal into a raw mode."""
20 mode = tcgetattr(fd)
21 mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
22 mode[OFLAG] = mode[OFLAG] & ~(OPOST)
23 mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB)
24 mode[CFLAG] = mode[CFLAG] | CS8
25 mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG)
26 mode[CC][VMIN] = 1
27 mode[CC][VTIME] = 0
28 tcsetattr(fd, when, mode)
29
30def setcbreak(fd, when=TCSAFLUSH):
31 """Put terminal into a cbreak mode."""

Callers 1

spawnFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected