While working on my port of screen for cygwin, I have tracked down the issue that did not allow me to reattach detached screens.
A detached screen process owns a certain tty to which the new, attaching screen process connects to and reads/writes to. Recent builds of cygwin return an EIO on a read from the tty, the following small change fixes this, but I have to admit that this is my first time swimming in the bowels of cygwin itself and I don't know if this makes sense or not. 2003-06-29 Rafael Kitover <[EMAIL PROTECTED]> * Fix EIO errors on background reads from a tty. Index: cygwin/fhandler_termios.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/fhandler_termios.cc,v retrieving revision 1.46 diff -u -p -r1.46 fhandler_termios.cc --- cygwin/fhandler_termios.cc 16 Jun 2003 03:24:10 -0000 1.46 +++ cygwin/fhandler_termios.cc 29 Jun 2003 14:59:13 -0000 @@ -160,7 +160,7 @@ fhandler_termios::bg_check (int sig) goto setEIO; else if (!sigs_ignored) /* nothing */; - else if (sig == SIGTTOU) + else if (sig == SIGTTOU || sig == SIGTTIN) return bg_ok; /* Just allow the output */ else goto setEIO; /* This is an output error */