add control-c and control-d handling to curses screen