From: Pablo Galindo Salgado Date: Tue, 11 Jun 2024 19:20:25 +0000 (+0100) Subject: gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (#120354) X-Git-Tag: v3.14.0a1~1530 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34e4d3287e724c065cc07b04a1ee8715817db284;p=thirdparty%2FPython%2Fcpython.git gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (#120354) --- diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py index f1a6b84adfb6..af9290819c2c 100644 --- a/Lib/_pyrepl/unix_console.py +++ b/Lib/_pyrepl/unix_console.py @@ -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) diff --git a/Misc/NEWS.d/next/Core and Builtins/2024-06-11-17-56-12.gh-issue-120221.si9hM9.rst b/Misc/NEWS.d/next/Core and Builtins/2024-06-11-17-56-12.gh-issue-120221.si9hM9.rst new file mode 100644 index 000000000000..3781576bc5a2 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2024-06-11-17-56-12.gh-issue-120221.si9hM9.rst @@ -0,0 +1,2 @@ +Deliver real signals on Ctrl-C and Ctrl-Z in the new REPL. Patch by Pablo +Galindo