Handle ctrl-c when running in console