Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <71A0F7B0F1F4F94F85F3D64C4BD0CCFE03FBE264@bmkc1svmail01.am.mfg> From: "Parker, Ron" To: cygwin AT cygwin DOT com Subject: RE: Patch and directions for compiling GNU screen 3.9.15 on cygwi n Date: Tue, 25 Nov 2003 17:08:08 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" > From: Igor Pechtchanski [mailto:pechtcha AT cs DOT nyu DOT edu] > Indeed. Mine was a bit more complex (see > ), but I > think it may > have enabled some features that this one doesn't. In any > case, I think > the attach feature won't work with this patch either. > > Ron, feel free to use any bits of the above patch you may > find useful. As Igor and others have noted there are issues reattaching to screen with the patch I posted last week. I usually detach screen just before closing my shell, so I never noticed the problem. Apparently reattaching fails if the parent bash session is still running. The behavior is also most reproducible when the initial screen is started with '-R'. If in is started with no arguments, there seems to be some variability in reattachment behavior. (Of course it is possible that my non-'-R' testing was not diligent enough). I'm sorry, but I've only had minimal time at home to debug this. It seems to be dying on the server/daemon side when attempting to open /dev/console. Given that, I suspected it might be somehow related to CYGWIN=tty ptys. Of course I know very little about pseudo-ttys, so I could be completely wrong. I was hoping that Corinna or someone else might be able to shed a little light on the behavior I am seeing. If you look at the following output from ps, you can see that both the PGID and TTY of the screen "server" changes as various things occur. With CYGWIN="binmode tty ntsec". From bash: PID PPID PGID WINPID TTY UID STIME COMMAND 2280 1 2280 2280 0 15316 16:25:17 /usr/bin/bash 2784 2280 2784 2796 0 15316 16:25:39 /usr/bin/ps After starting screen, from inside the screen session: PID PPID PGID WINPID TTY UID STIME COMMAND 2280 1 2280 2280 0 15316 16:25:17 /usr/bin/bash 2988 2280 2988 3000 0 15316 16:26:03 /usr/local/bin/screen-3.9.15 3016 2988 3016 3016 ? 15316 16:26:03 /usr/local/bin/screen-3.9.15 3044 3016 3044 3060 1 15316 16:26:04 /usr/bin/bash 3080 3044 3080 3092 1 15316 16:26:06 /usr/bin/ps After detaching: PID PPID PGID WINPID TTY UID STIME COMMAND 2280 1 2280 2280 0 15316 16:25:17 /usr/bin/bash 3016 1 3016 3016 ? 15316 16:26:03 /usr/local/bin/screen-3.9.15 I 3044 3016 3044 3060 1 15316 16:26:04 /usr/bin/bash 3156 2280 3156 3168 0 15316 16:26:33 /usr/bin/ps Reattaching, "screen -R", fails. After "stty sane": PID PPID PGID WINPID TTY UID STIME COMMAND 2280 1 2280 2280 0 15316 16:25:17 /usr/bin/bash 3016 1 3016 3016 0 15316 16:26:03 /usr/local/bin/screen-3.9.15 I 3044 3016 3044 3060 1 15316 16:26:04 /usr/bin/bash 3304 2280 3304 3316 0 15316 16:28:37 /usr/bin/ps Exiting and restarting bash: PID PPID PGID WINPID TTY UID STIME COMMAND 3016 1 3016 3016 0 15316 16:26:03 /usr/local/bin/screen-3.9.15 I 3044 3016 3044 3060 1 15316 16:26:04 /usr/bin/bash 3444 1 3444 3444 2 15316 16:29:45 /usr/bin/bash 3860 3444 3860 3872 2 15316 16:29:48 /usr/bin/ps Then "screen -R" succeeds: PID PPID PGID WINPID TTY UID STIME COMMAND 3016 1 3016 3016 0 15316 16:26:03 /usr/local/bin/screen-3.9.15 3044 3016 3044 3060 1 15316 16:26:04 /usr/bin/bash 3444 1 3444 3444 2 15316 16:29:45 /usr/bin/bash 3888 3444 3888 3900 2 15316 16:30:02 /usr/local/bin/screen-3.9.15 3960 3044 3960 3972 1 15316 16:30:13 /usr/bin/ps After this I can detach and reattach to the session willy-nilly. I don't think its possible to make screen reattachable without CYGWIN=tty, but here is the results of trying it anyway. With an empty CYGWIN environment variable. From bash: PID PPID PGID WINPID TTY UID STIME COMMAND 3048 1 3048 3048 con 15316 16:15:40 /usr/bin/bash 3792 3048 3792 3800 con 15316 16:15:45 /usr/bin/ps From screen: PID PPID PGID WINPID TTY UID STIME COMMAND 3048 1 3048 3048 con 15316 16:15:40 /usr/bin/bash 1708 3048 1708 2240 con 15316 16:16:52 /usr/local/bin/screen-3.9.15 2260 1708 2260 2260 ? 15316 16:16:52 /usr/local/bin/screen-3.9.15 816 2260 816 2084 0 15316 16:16:53 /usr/bin/bash 2500 816 2500 2608 0 15316 16:16:58 /usr/bin/ps After detaching: PID PPID PGID WINPID TTY UID STIME COMMAND 3048 1 3048 3048 con 15316 16:15:40 /usr/bin/bash 2260 1 2260 2260 ? 15316 16:16:52 /usr/local/bin/screen-3.9.15 I 816 2260 816 2084 0 15316 16:16:53 /usr/bin/bash 628 3048 628 2336 con 15316 16:18:12 /usr/bin/ps Reattaching, "screen -R", fails. Exited bash. After restarting bash: PID PPID PGID WINPID TTY UID STIME COMMAND 2260 1 2260 2260 ? 15316 16:16:52 /usr/local/bin/screen-3.9.15 I 816 2260 816 2084 0 15316 16:16:53 /usr/bin/bash 2780 1 2780 2780 con 15316 16:19:26 /usr/bin/bash 2772 2780 2772 2596 con 15316 16:19:29 /usr/bin/ps Reattaching still fails. Hopefully someone can give me a little guidance, since my debugging time is limited. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/