[3.12] gh-114328: tty cbreak mode should not alter ICRNL (GH-114335) (#114410)

The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition.
(cherry picked from commit fd49e22670)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
This commit is contained in:
Miss Islington (bot) 2024-01-22 00:41:03 +01:00 committed by GitHub
parent 4c42d98154
commit 33c1907de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 30 additions and 4 deletions

View file

@ -45,9 +45,6 @@ def cfmakeraw(mode):
def cfmakecbreak(mode):
"""Make termios mode cbreak."""
# Do not map CR to NL on input.
mode[IFLAG] &= ~(ICRNL)
# Do not echo characters; disable canonical input.
mode[LFLAG] &= ~(ECHO | ICANON)