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