Skip to content

Commit 3ccd0cd

Browse files
pablogsalpull[bot]
authored andcommitted
gh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new REPL (#120354)
1 parent 0fcf9d3 commit 3ccd0cd

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Lib/_pyrepl/unix_console.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,13 @@ def prepare(self):
324324
"""
325325
self.__svtermstate = tcgetattr(self.input_fd)
326326
raw = self.__svtermstate.copy()
327-
raw.iflag &= ~(termios.BRKINT | termios.INPCK | termios.ISTRIP | termios.IXON)
327+
raw.iflag &= ~(termios.INPCK | termios.ISTRIP | termios.IXON)
328328
raw.oflag &= ~(termios.OPOST)
329329
raw.cflag &= ~(termios.CSIZE | termios.PARENB)
330330
raw.cflag |= termios.CS8
331-
raw.lflag &= ~(
332-
termios.ICANON | termios.ECHO | termios.IEXTEN | (termios.ISIG * 1)
333-
)
331+
raw.iflag |= termios.BRKINT
332+
raw.lflag &= ~(termios.ICANON | termios.ECHO | termios.IEXTEN)
333+
raw.lflag |= termios.ISIG
334334
raw.cc[termios.VMIN] = 1
335335
raw.cc[termios.VTIME] = 0
336336
tcsetattr(self.input_fd, termios.TCSADRAIN, raw)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deliver real signals on Ctrl-C and Ctrl-Z in the new REPL. Patch by Pablo
2+
Galindo

0 commit comments

Comments
 (0)