From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23564 invoked from network); 20 Jun 1997 04:00:18 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 20 Jun 1997 04:00:18 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id XAA02773; Thu, 19 Jun 1997 23:41:30 -0400 (EDT) Resent-Date: Thu, 19 Jun 1997 23:41:30 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199706200345.XAA02203@hzoli.home> Subject: Re: zsh-3.0.3: another problem in Src/jobs.c In-Reply-To: <9706192332.AA00517@oz.fantasy.otsl.oki.co.jp> from SUZUKI Hisao at "Jun 20, 97 08:32:48 am" To: suzuki@otsl.oki.co.jp (SUZUKI Hisao) Date: Thu, 19 Jun 1997 23:45:06 -0400 (EDT) Cc: zsh-workers@math.gatech.edu (Zsh hacking and development) X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"NWZp-.0.Dh.flVgp"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3264 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu SUZUKI Hisao wrote: > [snip] > >! if (shout && !ttyfrozen && !jn->stty_in_env && inforeground) > > gettyinfo(&shttyinfo); > [snip] > > Aha! A simple and elegant patch! I am slightly worried since > it does not check the process group, but actually it seems to be > working very well. It should not depend on process groups. This should work if MONITOR is unset and on systems without job control. > However, I noticed a little bug (or, at least, a singular > behavior) just now. The variable "inforeground" referred in the > patch will not be set true if the last command in a pipeline is > in the current shell. Hence, though it is artificial, > > % stty erase ^H | : > > has no effect since the last command is a shell builtin ":", Yes. And actually, the tty settings should also be saved when a foreground process is suspended. The patch below is for the original zsh-3.1.2 and zsh-3.0.3, without Hisao's patch. I do hope that this covers all cases now. Zoltan *** Src/jobs.c 1997/06/03 03:52:01 3.1.2.7 --- Src/jobs.c 1997/06/20 03:37:03 *************** *** 138,145 **** job = jn - jobtab; /* compute job number */ if (somestopped) { ! if (jn->stty_in_env && !jn->ty) { ! jn->ty = (struct ttyinfo *) zalloc(sizeof(struct ttyinfo)); gettyinfo(jn->ty); } if (jn->stat & STAT_STOPPED) --- 138,146 ---- job = jn - jobtab; /* compute job number */ if (somestopped) { ! if ((jn->stty_in_env || ttyfrozen) && shout && job == thisjob) { ! if (!jn->ty) ! jn->ty = (struct ttyinfo *) zalloc(sizeof(struct ttyinfo)); gettyinfo(jn->ty); } if (jn->stat & STAT_STOPPED) *************** *** 155,161 **** } } ! if (shout && !ttyfrozen && !jn->stty_in_env) gettyinfo(&shttyinfo); if (isset(MONITOR)) { --- 156,162 ---- } } ! if (shout && !ttyfrozen && !jn->stty_in_env && job == thisjob) gettyinfo(&shttyinfo); if (isset(MONITOR)) {