X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 	tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <416096c60912040946r2369f4c4i1f44d7d65320e7f7@mail.gmail.com>
References: <4B184E76.60909@tlinx.org> 	 <416096c60912040946r2369f4c4i1f44d7d65320e7f7@mail.gmail.com>
Date: Fri, 4 Dec 2009 18:03:57 +0000
Message-ID: <416096c60912041003u18457d3ek85ec6b848dde4e8@mail.gmail.com>
Subject: Re: Why does exiting bash window kill off Gvim? (Windows version, but  	X-would be same question)
From: Andy Koppe <andy.koppe@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

2009/12/4 Andy Koppe:
> 2009/12/3 Linda Walsh:
>> In bash I start a copy of gvim.exe (64-bit windows version) in backgroun=
d.
>> 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. =C2=A0Why should bash or the console exiting kill off any pro=
cesses
>> 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.

Andy

--
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

