.bat from xterm opens cmd.exe window
Fri Mar 21 22:36:00 GMT 2003
I just happened to read the following thread in Cygwin. I am having the
same problem after I recently upgraded to a new version of cygwin.
The problem is that we have makefiles which call perl scripts. We use
dmake and ccperl (which is a Windows version of perl). I didn't fully
understand the explanation given here, but I am having the same problem
as the original poster. Each time I call dmake, it opens and closes
dozens of windows. I am guessing this happens for every invocation of
ccperl and any shell commands in the perl script or makefile. Since I am
the only one in the company using cygwin and the X environment, I cannot
change the makefiles.
I was wondering if any of you have a solution for this, especially since
this did not use to happen before. Please reply-all as I am not
subscribed to the list.
On Wed, Jan 08, 2003 at 07:01:08PM -0500, Igor Pechtchanski wrote:
>On Wed, 8 Jan 2003, Alexander Gottwald wrote:
>> On Wed, 8 Jan 2003, Igor Pechtchanski wrote:
>> > > > echo sleep 10 > test.bat
>> > > > ./test.bat
>> I had not verified that. How, after Igor stated that cmd shows up in
>> tried this too and it works for me. Even the snippet above displays
>> xterm window.
>FWIW, I'm getting the same behavior as reported by the original poster
>(i.e., any cygwin program called from a batch file from an xterm pops
>However, I believe I have an explanation of what's happening, though
>Cygwin programs running in an xterm have a tty that does not have a
>console window associated with it. When any cygwin program is invoked,
>checks (through a part of cygwin1.dll) whether it's running in a tty,
>if so, does not try to manipulate the console at all. However, when
>cmd.exe is run in such a setting, it loses the tty information. Thus,
>program invoked from this cmd.exe session has neither a tty nor a
>window, so it has to allocate one. Hope this makes sense.
That sounds like exactly what is going on, Igor. Thank you for
it so well.
>To the original poster: since there is no way to propagate tty
>through a cmd.exe session, I suppose the best solution would still be
>one Alexander proposed, i.e., live with it. Why would one want to call
>batch file from an xterm, anyway?
Especially a .bat file that is calling cygwin programs.
More information about the Cygwin-xfree