mirror of
https://github.com/python/cpython.git
synced 2025-09-12 11:46:52 +00:00
[3.13] gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (GH-120354) (#120368)
This commit is contained in:
parent
a6c4080aaa
commit
7aafa305d4
2 changed files with 6 additions and 4 deletions
|
@ -324,13 +324,13 @@ class UnixConsole(Console):
|
|||
"""
|
||||
self.__svtermstate = tcgetattr(self.input_fd)
|
||||
raw = self.__svtermstate.copy()
|
||||
raw.iflag &= ~(termios.BRKINT | termios.INPCK | termios.ISTRIP | termios.IXON)
|
||||
raw.iflag &= ~(termios.INPCK | termios.ISTRIP | termios.IXON)
|
||||
raw.oflag &= ~(termios.OPOST)
|
||||
raw.cflag &= ~(termios.CSIZE | termios.PARENB)
|
||||
raw.cflag |= termios.CS8
|
||||
raw.lflag &= ~(
|
||||
termios.ICANON | termios.ECHO | termios.IEXTEN | (termios.ISIG * 1)
|
||||
)
|
||||
raw.iflag |= termios.BRKINT
|
||||
raw.lflag &= ~(termios.ICANON | termios.ECHO | termios.IEXTEN)
|
||||
raw.lflag |= termios.ISIG
|
||||
raw.cc[termios.VMIN] = 1
|
||||
raw.cc[termios.VTIME] = 0
|
||||
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue