Re: gnotes+ editor strangeness



On Fri, Mar 19, 1999 at 11:42:10AM -0500, Andy Kahn was heard to say:
> > "&" is used for daemonizing
> 
> no.  it's for running a process in the background.  some programs
> don't need to do this because they do it automatically.  i think you
> are confused as to what fork() and the shell character '&' produces.
> 
> 
> > the way gnp is setup, "&" is worthless, and you have to remember a special
> > switch to not fork it...
> 
> using a '&' will just cause control to return to your shell
> immediately.  use the "--nofork" option to prevent gnp from
> automatically forking itself and running in the background.
> 

  There is a very good reason (IMO) for gnp to not fork away from the shell.
Many programs and scripts use environment variables and configuration options
to decide what text editor to use.  Most text editors block until they are
exited; however, gnp and gvim, which share this behavior, do not.  With
some programs (eg, CVS) this can be worked around by specifying a "don't fork"
option to the editor as part of the EDITOR environment variable; however, some
seem to use the environment variable as a program _name_ and therefore
try to exec the program "gvim -f".  This is broken, but it still has to be
taken into consideration.

  The only programs (besides gnp and gvim) that I've seen that fork themselves
to the background by default are things like gdm and pppd that are almost always
run as daemons.  'Daemonizing' a text editor breaks the expected behavior of a
UNIX program and requires a workaround every time that a script asks for
a text editor.  IMO, the default setting should be to not detach; the user
could configure it to detach as a configure option or do "alias gnp gnp --fork"
but it shouldn't fork by default.

  Of course, it's your program and you're free to do this however you want
I suppose. ;-)

  Daniel

-- 
  Fate always wins...at least, when people stick to the rules.

             -- Terry Pratchett, _Interesting Times_



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]