delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/04/08:42:10

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-Id: <4B19119F.2040500@saic.com>
Date: Fri, 04 Dec 2009 08:41:51 -0500
From: "Roger K. Wells" <ROGER DOT K DOT WELLS AT saic DOT com>
User-Agent: Thunderbird 2.0.0.23 (X11/20090812)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Why does exiting bash window kill off Gvim? (Windows version, but X-would be same question)
References: <4B184E76 DOT 60909 AT tlinx DOT org>
In-Reply-To: <4B184E76.60909@tlinx.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

Linda Walsh wrote:
> 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?
>
I have had the same frustration for a while.  When in a bash shell start 
gvim with:
cmd /c gvim
then you can exit the bash shell without killing gvim.
FWIW:
I am using gvim v7.0 for 32bit MS-Windows
it is set up as a server by sourcing the following in .bash_profile:

function gvim
{
    if [ -z "$1" ] ; then
        $VIMRUNTIME/gvim.exe --servername GVIM &
    else
        $VIMRUNTIME/gvim.exe --servername GVIM --remote-silent $1 &
    fi
}

cheera,
roger wells
> It would be the same question of it was the win32-X based Gvim -- it 
> would
> be killed as well, but one could argue that cygwin has to shut down all
> cygwin processes when it exits -- but I still don't see that as being
> necessary.
>
> It's certainly not what happens when I log into a linux workstation and
> bring up Gvim displaying locally (an X version, not a Windows
> version...:-)).  I can terminate the tty window to a linux box and the X
> program just keeps on running (unless I was running it's display 
> through a
> copy of SSH that terminates with the window's exit.  I try to avoid that
> on my local network.
>
> So why does cygwin have to terminate any processes when I exit the shell
> window?  If I've disowned the job, I obviously don't care about any 
> output
> -- I could use nohup in front of it, if I wanted to capture such, but it
> wouldn't matter, they all seem to be required to die, and I don't
> understand why.
>
> I find it ironic to think about the discussion about characters when
> something important like jobs running in background normally doesn't even
> work right, but I don't understand why it has to be that way. 
> I find it *especially* annoying, when it kills off a windows program --
> there can be no good reason for that.
>
> I guess I also don't quite get why I don't get back immediate control
> when I start gvim under bash.exe, but if I start cmd.exe within bash,
> then gvim behaves 'normally' (auto backgrounds and doesn't terminate
> when cygwin does).  So it's obvious that there's no reason, at least,
> why cygwin should "go out of its way" to kill off any launched
> processes.  Or does it not do that? 
>
> linda
>
>
> -- 
> 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
>
>


-- 
Roger Wells, P.E.
SAIC
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger DOT k DOT wells AT saic DOT com


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