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: -mwindows and --Wl,subsystem,windows

Dave Korn:
> Andy Koppe wrote:
>> According to this post on the gcc mailing list a few years back, gcc's
>> -mwindows option should imply --Wl,subsystem,windows:
> ? Yep, it still does.

Ah, you're right. I seem to have confused myself about this while
grappling with MinTTY issue 39: "Command shell window remains open in
Windows 7 Beta".

It would appear that something's changed in how Windows deals with
Cygwin applications. The fact that MinTTY actually is compiled as a
"windows" subsystem app after all makes this even more curious.

I'm finding that MinTTY itself causes a console to open without any
output that would necessitate it. That can be got rid of with
FreeConsole(), but then the command invoked by MinTTY (using forkpty()
and execve()) opens a console anyway. Apart from that, things work
fine though.

rxvt uses the hack below to just hide any console window. Perhaps I
should just go with that, but I'm a bit concerned that it might end up
hiding the wrong console, or that the console might reappear for some
reason anyway.


char app_name[40];
sprintf(app_name, "rxvt%08x", (unsigned int)GetCurrentThreadId());
SetConsoleTitle( app_name );
while ((conwin = FindWindow( NULL, app_name))==NULL)
    Sleep( 40 );
ShowWindowAsync(conwin, SW_HIDE);

Unsubscribe info:
Problem reports:

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