windows-curses
windows-curses copied to clipboard
CTRL-C doesn't raise KeyboardInterrupt
Hello, I found CTRL-C doesn't raise KeyboardInterrupt in windows-curses.
import time
import curses
def main(stdscr):
begin_x, begin_y = 20, 7
width, height = 40, 5
win = curses.newwin(height, width, begin_y, begin_x)
win.scrollok(1)
while True:
k = win.getch()
win.addstr(f'key {str(k)} typed.\n')
win.refresh()
time.sleep(0.1)
if __name__ == "__main__":
print(curses.wrapper(main))
The code above shows key 3 typed.
for CTRL-C in windows-curses. This is raw mode behaviour.
In Linux, CTRL-C raises KeyboardInterrupt.
Both are Python 3.8.1.