Clear all POSIX.1-2017 local mode flags in tty.cfmakeraw().

Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
This commit is contained in:
Soumendra Ganguly 2020-12-15 06:43:36 -06:00
parent a68414222d
commit 3673a79bbc
1 changed files with 4 additions and 7 deletions

View File

@ -29,19 +29,16 @@ def cfmakeraw(mode):
INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF)
# Do not post-process output.
mode[OFLAG] &= ~(OPOST)
mode[OFLAG] &= ~OPOST
# Disable parity generation and detection; clear character size mask;
# let character size be 8 bits.
mode[CFLAG] &= ~(PARENB | CSIZE)
mode[CFLAG] |= CS8
# Do not echo characters (including NL); disable canonical input; disable
# the checking of characters against the special control characters INTR,
# QUIT, and SUSP (disable sending of signals using control characters);
# disable any implementation-defined special control characters not
# currently controlled by ICANON, ISIG, IXON, or IXOFF.
mode[LFLAG] &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN)
# Clear all POSIX.1-2017 local mode flags.
mode[LFLAG] &= ~(ECHO | ECHOE | ECHOK | ECHONL | ICANON |
IEXTEN | ISIG | NOFLSH | TOSTOP)
# POSIX.1-2017, 11.1.7 Non-Canonical Mode Input Processing,
# Case B: MIN>0, TIME=0