Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clear all POSIX.1-2017 local mode flags in tty.cfmakeraw().
Signed-off-by: Soumendra Ganguly <soumendraganguly@gmail.com>
  • Loading branch information
8vasu committed Dec 15, 2020
commit 3673a79bbcac97b075a4487bfd8f3cf11d02c567
11 changes: 4 additions & 7 deletions Lib/tty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down