Path: utzoo!utgpu!watmath!uunet!visix!jeff From: jeff@visix.UUCP (Jeff Barr) Newsgroups: gnu.bash.bug Subject: Re: SIGINT and bash on Sys5 Summary: Set the Process Group! Message-ID: <215@visix.UUCP> Date: 3 Aug 89 21:46:28 GMT References: <13695.8908021336@holly.fulcrum.bt.co.uk> Distribution: gnu Organization: Visix Software, Arlington, Virginia Lines: 34 In article <13695.8908021336@holly.fulcrum.bt.co.uk>, igb@fulcrum.british-telecom.co.uk (Ian G Batten) writes: > > I reported earlier today an interaction between Emacs and Bash on System V. > We investigated further and found the problem occurred with all SIGINTs. > If multiple shells were run from each other and then ``cat'' was run, a > Control-C to cat got a prompt from EACH shell stacked up and possibly > killed the top one. > I don't know anything about Bash, but this is a symptom of the shell not putting child processes in their own process group. The terminal driver sends the Interrupt signal to all processes in the highest process group (and some other condition), not to all processes of the terminal. Code similar to the following is needed when running child processes: if (p = fork ()) /* parent side */ else { setpgrp (); exec (.....); } On Berkeley systems, setpgrp needs an argument. Not having seen or used Bash, this may be totally wrong........ :-(. Jeff /\ Jeff Barr \ / Visix Software, Inc. /\ 800-832-8668 \ / / \ uunet!visix!jeff \ / 1525 Wilson Blvd. / \ 703-841-5858 \ / / \ \/ Arlington, VA 22209 / \ \/