This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: .bat from xterm opens cmd.exe window


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 xterm I
> tried this too and it works for me. Even the snippet above displays in the
> xterm window.
>
> bye
>         ago

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 up a
new window).

However, I believe I have an explanation of what's happening, though not a
solution:
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, it
checks (through a part of cygwin1.dll) whether it's running in a tty, and
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, a
program invoked from this cmd.exe session has neither a tty nor a console
window, so it has to allocate one.  Hope this makes sense.

To the original poster: since there is no way to propagate tty information
through a cmd.exe session, I suppose the best solution would still be the
one Alexander proposed, i.e., live with it.  Why would one want to call a
batch file from an xterm, anyway?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]