Skip to content

Commit

Permalink
pythongh-120221: Deliver real singals on Ctrl-C and Ctrl-Z in the new…
Browse files Browse the repository at this point in the history
… REPL (python#120354)
  • Loading branch information
pablogsal committed Jun 11, 2024
1 parent 203565b commit 34e4d32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/_pyrepl/unix_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deliver real signals on Ctrl-C and Ctrl-Z in the new REPL. Patch by Pablo
Galindo

0 comments on commit 34e4d32

Please sign in to comment.