Commit 91e1ba304a

91e1ba304abf73ccb8843f169bf08d187d152eaf

parent: 2c2f262088

Unsigned

Wraient <wraient.911@gmail.com> · 2024-10-12 22:11 UTC

Exit in curses

Layout: unified · split

curd.py +7 −2
@@ -467,8 +467,13 @@ def select_anime(anime_list):
467 stdscr.addstr(display_idx, 0, anime) 467 stdscr.addstr(display_idx, 0, anime)
468 468
469 # Get user input 469 # Get user input
470 key = stdscr.getch() 470 try:
471 471 key = stdscr.getch()
472 except KeyboardInterrupt:
473 curses.endwin()
474 print("Have a great day!")
475 os._exit(0)
476
472 # Handle key inputs 477 # Handle key inputs
473 if key in [curses.KEY_BACKSPACE, 127, 8]: 478 if key in [curses.KEY_BACKSPACE, 127, 8]:
474 current_input = current_input[:-1] 479 current_input = current_input[:-1]