Questions about windows support

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Feb 21 15:36:44 PST 2012


On Tue, Feb 21, 2012 at 11:35:09PM +0100, Adam D. Ruppe wrote:
> On Tuesday, 21 February 2012 at 22:26:34 UTC, Nick Sabalausky wrote:
> >On other thing I meant to mention: It's kinda annoying on Linux
> >how if you launch a gui app at the command line, it will
> >automatically be a blocking foreground process unless
> >you remember to add "&" at the end. Which I always forget.
> 
> You can also hit ctrl+z in that terminal to pause the gui app,
> then hit "bg" in there to move it to the background.
> 
> Tho it still spams the text iirc.

You can do:

	program_name >/dev/null 2>&1 &

That will silence everything. But yeah, too much typing, too much
obscure stdout/stderr redirecting for a newbie to even begin to dream
that such things are possible.

A good default behaviour (for the app writer) is to fork() at startup,
detach from pty in child, and then exit parent.  A couple o' programs do
this.


> I kinda like how linux apps keep it though. It's just so easy to throw
> in a printf() from time to time to tell something to me without doing
> a popup window or something.

You can disable the fork() in debug builds (or with a -debug flag) so
that you can still get error messages out of it when something goes
wrong.

I'm pretty sure this is common knowledge, just that nobody bothers to do
it. But I can dream. :)


T

-- 
The two rules of success: 1. Don't tell everything you know. -- YHL


More information about the Digitalmars-d mailing list