mirror of
https://github.com/python/cpython.git
synced 2025-09-12 19:57:40 +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)
|
self.__svtermstate = tcgetattr(self.input_fd)
|
||||||
raw = self.__svtermstate.copy()
|
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.oflag &= ~(termios.OPOST)
|
||||||
raw.cflag &= ~(termios.CSIZE | termios.PARENB)
|
raw.cflag &= ~(termios.CSIZE | termios.PARENB)
|
||||||
raw.cflag |= termios.CS8
|
raw.cflag |= termios.CS8
|
||||||
raw.lflag &= ~(
|
raw.iflag |= termios.BRKINT
|
||||||
termios.ICANON | termios.ECHO | termios.IEXTEN | (termios.ISIG * 1)
|
raw.lflag &= ~(termios.ICANON | termios.ECHO | termios.IEXTEN)
|
||||||
)
|
raw.lflag |= termios.ISIG
|
||||||
raw.cc[termios.VMIN] = 1
|
raw.cc[termios.VMIN] = 1
|
||||||
raw.cc[termios.VTIME] = 0
|
raw.cc[termios.VTIME] = 0
|
||||||
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
|
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Deliver real signals on Ctrl-C and Ctrl-Z in the new REPL. Patch by Pablo
|
||||||
|
Galindo
|
Loading…
Add table
Add a link
Reference in a new issue