From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10349 invoked from network); 26 Sep 2003 16:55:06 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 26 Sep 2003 16:55:06 -0000 Received: (qmail 49 invoked by alias); 26 Sep 2003 16:54:35 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19140 Received: (qmail 29007 invoked from network); 26 Sep 2003 16:52:53 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 26 Sep 2003 16:52:53 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [129.199.96.32] by sunsite.dk (MessageWall 1.0.8) with SMTP; 26 Sep 2003 16:52:53 -0000 Received: from clipper.ens.fr (clipper-gw.ens.fr [129.199.1.22]) by nef.ens.fr (8.12.10/1.01.28121999) with ESMTP id h8QGqqv1089643 for ; Fri, 26 Sep 2003 18:52:53 +0200 (CEST) Received: from (george@localhost) by clipper.ens.fr (8.12.3/jb-1.1) Date: Fri, 26 Sep 2003 18:52:51 +0200 From: Nicolas George To: zsh-workers@sunsite.dk Subject: Subshell exiting, suspend problem Message-ID: <20030926165251.GA14940@clipper.ens.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="huq684BweRXVnRxX" Content-Disposition: inline User-Agent: Mutt/1.4 --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable There seems to be a problem with zsh process group handling: when zsh is invoked as an interactive subshell from a curses-based program (by example with :shell from vim, but the same is true with mutt, less, flrn...), when zsh exits, the calling process gets suspended for "tty output" (only if it is under job control, or else it makes a read error). The problem arises with zsh 4.1.1, or with a CVS snapshot from half an hour ago, and also with the Debian-patched 4.0.7. I have tracked the problem, and it seems that acquire_pgrp() is called from init_io(), but release_pgrp() is never called. The following patch fixes the problem: --- Src/builtin.c 2003-09-26 16:16:45.000000000 +0200 +++ Src/builtin.c.orig 2003-09-26 16:16:09.000000000 +0200 @@ -3977,9 +3977,6 @@ if (sigtrapped[SIGEXIT]) dotrap(SIGEXIT); runhookdef(EXITHOOK, NULL); - if (opts[MONITOR] && interact && (SHTTY !=3D -1)) { - release_pgrp(); - } if (mypid !=3D getpid()) _exit(val); else But I am not quite sure if this is exactly the right thing: maybe the correct condition is to call release_pgrp() if and only if acquire_pgrp() was called. The only thing I am sure is that something like that is necessary. Regards, --=20 Nicolas George --huq684BweRXVnRxX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (SunOS) iD8DBQE/dG7fsGPZlzblTJMRAqD8AKDMhWbfgTnJ/DwEhsiYJYS6CSq4fACeP/US Zv2kUA0Yv/pIh03Y28flI6M= =fLMZ -----END PGP SIGNATURE----- --huq684BweRXVnRxX--