gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (#120354)

This commit is contained in:
Pablo Galindo Salgado 2024-06-11 20:20:25 +01:00 committed by GitHub
parent 203565b2f9
commit 34e4d3287e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -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)

View File

@ -0,0 +1,2 @@
Deliver real signals on Ctrl-C and Ctrl-Z in the new REPL. Patch by Pablo
Galindo