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: Console anyone ? (was: xterm is a console program?)


On Wed, 21 May 2003, Ehud Karni wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Wed, 21 May 2003 10:14:44 -0400, Harold L Hunt II <huntharo@msu.edu> wrote:
> > >
> > > This, actually, is a *very* good point!  Most X apps will communicate with
> > > the console, if only to show errors or help messages (run your favorite X
> > > app with --help and see if it doesn't print to the console).  So, to
> > > answer the question in the subject, *yes, an xterm IS a console app*.
> > >
> >
> > Right, just like how you can't get info from XWin.exe -help right now
> > because we *had* to make it a Windows app instead of a console app (or
> > even a console app with auto-detach) because there isn't currently a
> > good solution to this problem.
>
> I use the -mwindows compilation switch (and using main and NOT winmain)
> to get a Cygwin program without console and without (visible) window.
>
> To communicate with the user I use message boxes. I've written a
> subroutine that forks (so the calling program can continue) and
> the child display the message.
>
> Debugging and informative messages are still written to stderr/stdout
> which means that if it is run from bash/tcsh (without redirection), the
> messages are seen on the console. You can redirect the output even when
> it is run from Windows (but you can see the messages file only when the
> program is over, quite enough for informative/statistics).
>
> > The policy isn't "no console ever".  The policy is "detach from consoles
> > created specifically for this process, remain attached to consoles that
> > this process is launched from".  Thus, if you launch from bash you get
> > console output.  If you launch from Start->Run or by double-clicking the
> > app you don't get a new console spawned specifically for that app.
>
> See my comment on stderr + redirection above.
>
> Ehud.

Ehud,

Can you still see the output of your program if it's run from an xterm?

It seems that some programs (in particular, "net" in Win2k) have a problem
with xterms -- they would still pop up a new console, but only when
writing to stderr!  When writing to stdout, this doesn't happen.  To
reproduce, try "net help" and "net use" -- the first will pop up a
console, the second won't.
	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!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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