Dun Peal wrote:
> This problem has been plaguing me for years now, and still now with
> the recent 4.6.2 release.

Ah!

> Steps to reproduce:
> 1. Start a new screen session.
> 2. Create a new window.
> 3. Hit Ctrl-D. Window closes instantly.
> 4. Start another windows.
> 5. Run the following bash command: sleep 100 &
> 6. Hit Ctrl-D. Window will hang in dead state until you kill the sleep
> process, or about 7-9 seconds elapse - whichever comes sooner.
> 
> I had a friend reproduce the problem on 4.6.2 in Arch Linux (I'm on
> Ubuntu) and another reproduce it on 4.05.00 (Debian 9).
> 
> Any ideas?

For one the stdout, stderr, and stdin are not redirected when
launching 'sleep 100' in the background.  Those file descriptors will
be attached and still open until the sleep process exits.  That is
what is keeping that terminal open.

If you want to launch a process into the background as a daemon then
redirect the three I/O file descriptors first.  Then the window close
will be immediate.

  sleep 100 >/dev/null 2>&1 </dev/null &

As to the why of the time delay before screen notices, that I don't
know, but perhaps zombie_timeout?

Bob

_______________________________________________
screen-users mailing list
screen-users@gnu.org
https://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to