[haiku-development] Re: Bash and Jobs

  • From: "Timothy Brown" <stimbrown@xxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 29 Aug 2007 23:34:57 +1000

On Wed, 29 Aug 2007 08:28:46 -0400, "Ryan Leavengood"
<leavengood@xxxxxxxxx> said:
> Is there a reason Linux does it this way? Or is it just some weird
> side affect of how X Windows works? Because obviously the whole
> closing the window thing only comes with GUIs.

Linux doesn't do it this way. The inconsistency is with haiku. Load up
an xterm in Linux using bash, run a background process like 'xclock &'
and then type 'exit'. Bash will tell you there are running processes and
take you back to the prompt. If I remember correctly, there is a way to
forcibly close the shell which cascades the SIGHUP signal to the child
processes (and to their child processes etc). Closing the xterm window
is the same and as forcing the shell to exit. If you want the child
process to stay around, use 'nohup' or use zsh and use '&!' instead of
'&'. Personally I prefer this behavior, but then it is what I know. I
think of processes which are started in a tree like fashion, so killing
off a parent should automatically kill off the children. I do accept,
however, that that is a very computer science based approach and may not
necessarily be the most obvious to an Average Joe.

Either way, I believe 'exit' and closing the terminal should behave the
same, preferably with the option of changing the behavior if it is not
the way I like it :P.

Stim

Other related posts: