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]

Console anyone ? (was: xterm is a console program?)


-----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 Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+y7nlLFvTvpjqOY0RAgoSAJ9INjz5ZdDM8zxvXIcy81osnBd3gACfSzqG
LVNo35/zZCD8gsmXshTk5Fk=
=gpWY
-----END PGP SIGNATURE-----


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