The attached patch uses stdin instead of opening /dev/tty for run-time
interaction. It makes it shorter and, except for handling non-blocking
mode, very simple.
I assume the Cygwin part of tty_getchar() is still required.
Everything I added in the patch is in POSIX.1, so it should be very
portable to non-Windows platforms (and probably more portable than
opening /dev/tty, etc.).
Also, really, tty_done() probably isn't needed because we're modifying
stdin and not a terminal, so when we exit (the only time it's called)
it's not going to affect anything. But leaving it shouldn't hurt either.
I've tested it quite a bit and everything seems to work fine.
It's a diff against 4.20ALPHA8
Thanks,
Kris Katterjohn