Unfinished, but this versin doesn't hang after receiving SIGINT!