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 Wed, 21 May 2003, Alexander Gottwald wrote:

> On Tue, 20 May 2003, Early Ehlinger wrote:
> > In other words, on Linux (and the various Unices out there), starting an X
> > app does *not* cause a new console to be created.  Said app will re-use its
> > parent's console or use /dev/null.  Ergo, the same ought to be made true on
> > Windows.
>
> It will always use the parent stdin/stderr/stdout (which might be the console).
> On Windows you don't have a parent stdin/stderr/stdout to attach, so Windows
> creates them with the console.
>
> > > The evil hack is to include the code into the X11 library. This is
> > > the last place where I want to see code that detaches the console.
> > > The correct place is in cygwin1.dll, in the startup code. And this
> > > issue should be discussed on the cygwin-devel mailing list.
> >
> > I originally thought about it going in cygwin1.dll but dismissed that before
> > posting. The reason was that if you put it in cygwin1.dll, then any cygwin
> > app would drop its console if launched in this manner, including non-X
> > clients like bash.
>
> This is also wrong for a lot of X11 applications. Just imagine the debug
> nighmare when the user never sees the "Can't connect to display" message
> and crys "xterm bombs!!!!! :( Plz Help"

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*.

The functionality that Early proposes might be useful, but it certainly is
not something to have *by default*.  A Cygwin-specific command-line switch
(if it's implementable -- I don't know) is a good compromise, and,
although that *will* require changing each individual application, it
sounds much better than the "no console ever" policy.

> > That would clearly be Wrong so I suggested having it in
> > the X11 client library.  I'm still unconvinced that the X11 client library
> > is the appropriate place for this, but I haven't seen any better
> > alternatives suggested yet.
>
> There is no general difference between an X11 app and any other cygwin app.
> There is also the sshd, which does not need the console but displays it.
>
> The only suitable place for such a functionality is cygwin1.dll. Maybe with
> a compiletime switch to force the program to keep the console (for bash,
> mutt ....). But this code does not belong into libX11 and I doubt that any
> member of the XFree crew will ever apply such a change to cvs.
>
> bye
>         ago

If such functionality is released, the best place for it, IMO, is what CGF
suggested, i.e., a separate hideconsole.o which apps link against; it can
even come in its own package, independent of either cygwin or xfree*.
	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]