xterm is a console program?

Harold L Hunt II huntharo@msu.edu
Thu May 15 15:40:00 GMT 2003


Benny,

>>A simple WinMain that parses GetCommandLine and calls main() would
>>do the trick, I think.
> 
> 
> I think the runtime already does that automatically.  You really only
> need to add -mwindows for the link step.
> 

That is correct.

Of course, another issue remains: Even non-console apps (such as xterm) 
dump error information to the console.  These error messages are forever 
lost and prevented from being seen if we add -mwindows to the link line. 
  This makes me prefer run-time solutions, such as using "run.exe". 
With that in mind, here is what I have to say about -mwindows, if we 
ever chose to obliterate error messages.


However, we haven't added this link flag for all executables (which I 
think is the only granularity we have) because some of the executables 
in the build tree *do* have console output only.

Case in point:
1) Open a cmd or command prompt

2) cd \cygwin\usr\X11R6\bin

3) startxwin.bat (starts X, sets PATH and DISPLAY)

4) xdpyinfo

Notice that xdpyinfo dumps its into to the cmd or command console. 
Adding -mwindows to all executables would disconnect xdpyinfo from the 
console and would not allow it to print its info in a cmd/command window 
anymore.  I am not sure what would happen if you ran it under bash 
(Cygwin shell) or within an xterm.  I have a feeling that it wouldn't 
output its data under any shell, which would be most unfortunate.


So, we have two choices:

1) Evaluate individual candidates for addding the -mwindows flag to 
their link command.

2) Check for, or add, a finer granularity of adding link flags to only 
non-console apps in the build tree.


Thoughts?  (Don't forget my comments about error messages at the top)

Harold




More information about the Cygwin-xfree mailing list