fix tty hanging on linux