Skip to content

Commit 93a3db5

Browse files
committed
un-ikanoborify the SIGINT raising (curses.raw(True) turns C-c into a "^C"
character)
1 parent 3047fe2 commit 93a3db5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bpython/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,16 @@ def push(self, s):
902902
s = s.rstrip('\n')
903903
self.buffer.append(s)
904904

905+
# curses.raw(True) prevents C-c from causing a SIGINT
906+
curses.raw(False)
905907
try:
906908
more = self.interp.runsource('\n'.join(self.buffer))
907909
except SystemExit:
908910
# Avoid a traceback on e.g. quit()
909911
self.do_exit = True
910912
return False
913+
finally:
914+
curses.raw(True)
911915

912916
if not more:
913917
self.buffer = []

0 commit comments

Comments
 (0)