delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/04/13:14:19

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 4 Dec 2009 13:13:59 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Why does exiting bash window kill off Gvim? (Windows version, but X-would be same question)
Message-ID: <20091204181359.GB2976@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <4B184E76 DOT 60909 AT tlinx DOT org> <416096c60912040946r2369f4c4i1f44d7d65320e7f7 AT mail DOT gmail DOT com> <416096c60912041003u18457d3ek85ec6b848dde4e8 AT mail DOT gmail DOT com>
MIME-Version: 1.0
In-Reply-To: <416096c60912041003u18457d3ek85ec6b848dde4e8@mail.gmail.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, Dec 04, 2009 at 06:03:57PM +0000, Andy Koppe wrote:
>2009/12/4 Andy Koppe:
>> 2009/12/3 Linda Walsh:
>>> In bash I start a copy of gvim.exe (64-bit windows version) in background.
>>> I disown the job in bash so bash no longer manages the job -- it should be
>>> a free and clear process (unaffected by bash exiting).
>>>
>>> Yet when I exit the bash window (bash running in a console window), Gvim
>>> is killed. ??Why should bash or the console exiting kill off any processes
>>> running in the background?
>>
>> Were you closing the console window by pressing the close button?
>>
>> In that case, the problem is that gvim is built as a console program,
>> which means that it will have attached to bash's console. When a
>> console is closed, all processes attached to it are terminated.
>>
>> I think that's a bug, because gvim has no need for a console and
>> therefore should be built with -Wl,subsystem,windows.
>
>Hang on, if I do this:
>
>$ setsid gvim -display :0 &
>
>in a bash console and then close the console, gvim continues to work,
>so either setsid or gvim itself does detach from the console.

That makes sense.  Cygwin sends explicit SIGHUPs to other members of the
console process group when it receives a CTRL_CLOSE_EVENT.  setsid should
fix that.

You shouldn't need the '&' in the above scenario.  Did that actually make
a difference?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019