This is the mail archive of the cygwin mailing list for the Cygwin 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: Windows 7 64 Bit flashes DOSBox visible on Desktop when using run-1.3.0 or run2-0.4.2 to start Cygwin commands


Hi,

On Tue, 28 Jan 2014 12:15:31 +0100, Marco Atzeri <marco.atzeri@gmail.com>
wrote:
> On 28/01/2014 10:37, dyle wrote:
>> Hi *,
...
> if you need to run a series of command, why don't you use
> the mintty terminal ?

The User should not get any Window at all. Not even a mintty.

> I do not understand what are you trying to achieve with run,
> it seems the wrong tool for your example.
> 
> If you want to put a stop just before closing the scripts,
> just add a read
> "#!/bin/sh <CR> ls -1 | > wc -l > count_file.txt <CR> read"
> 
> and it will wait a "Return" before completing the script and
> closing the window.

The problem is not the too-fast closing of the window but its opening in
the first place. The script above is a mere example.

>> Also I looked up the cygwin (and winsup) sources but was not lucky to
>> find
>> any code or run or run2. And there's no reference whatsoever in
>> /usr/share/doc/run and /usr/share/doc/run2 on where to *obtain* the
>> sources
>> for these packages. They do not seem to be included in the regular
cygwin
>> CVS.
> 
> use setup do download the source package.
> All sources are available on "Select Packages" window,
> forth column is called "Scr ?"
> 
> Check the box, it will be deployed in "/usr/src"

GREAT! Thank you Marco!

With this I see, that the error is clearly at run2_gpl.c at line 350ff:

   if (bUseMessageOnlyWorkaround)
     {
       if (!bHaveConsole)
         {
           AllocConsole ();
           bHaveConsole = TRUE;
           SetParent ((*GetConsoleWindowFP) (), HWND_MESSAGE);
         }
     }
   else if (!bHaveConsole)
     {
       bHaveConsole = run2_setup_invisible_console ();
     }


For Windows 7 the bUseMessageOnlyWorkaround is always TRUE and as I do not
have a Console Window yet the AllocConsole() function of Win32 API is
called.

This pops up a Console Window. A DOS-BOX. And there is no help to this.
Windows 7 just goes on, fires up a Window and places a cmd-prompt inside
it. Right in your face. :(

If I comment this line with

           // AllocConsole ();

then my scripts do work as expected: No DOS-BOX window pops up. Yeee!

Though stdout, stderr might be messy then. I might run in other troubles,
since there's a reason for this call. But so far this ok for me (yet).


Thx,
Oliver

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


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