https://github.com/python/cpython/commit/7aafa305d40fe2aad2d2e2fad4079fb868dd2e7e
commit: 7aafa305d40fe2aad2d2e2fad4079fb868dd2e7e
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: pablogsal <[email protected]>
date: 2024-06-11T19:46:07Z
summary:

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

files:
A Misc/NEWS.d/next/Core and 
Builtins/2024-06-11-17-56-12.gh-issue-120221.si9hM9.rst
M Lib/_pyrepl/unix_console.py

diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py
index f1a6b84adfb671..af9290819c2c78 100644
--- a/Lib/_pyrepl/unix_console.py
+++ b/Lib/_pyrepl/unix_console.py
@@ -324,13 +324,13 @@ def prepare(self):
         """
         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 00000000000000..3781576bc5a257
--- /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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to