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: xterm is a console program?


On Thu, 15 May 2003, Harold L Hunt II wrote:

> 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

Harold,

Note that nothing prevents non-console programs from calling
AllocateConsole which would use a console if one is available, or create a
new one.  However, AFAIU, *all* Cygwin apps are non-console apps!  They
will call AllocateConsole if necessary, but they would rather use the pty
if available.
	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!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


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