zsh-workers
 help / color / mirror / code / Atom feed
* Subshell exiting, suspend problem
@ 2003-09-26 16:52 Nicolas George
  2003-09-26 17:38 ` Bart Schaefer
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Nicolas George @ 2003-09-26 16:52 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

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 != -1)) {
-	release_pgrp();
-    }
     if (mypid != 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,

-- 
  Nicolas George

[-- Attachment #2: Type: application/pgp-signature, Size: 185 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-10-21  7:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-26 16:52 Subshell exiting, suspend problem Nicolas George
2003-09-26 17:38 ` Bart Schaefer
2003-09-27  3:21   ` Philippe Troin
2003-09-27 21:00     ` Bart Schaefer
2003-09-26 18:32 ` Philippe Troin
2003-10-03 20:58 ` [19140] " Danek Duvall
2003-10-03 22:06   ` Philippe Troin
2003-10-03 22:24     ` Danek Duvall
2003-10-08  7:04       ` Danek Duvall
2003-10-08  7:26         ` Philippe Troin
2003-10-17 16:54           ` Philippe Troin
2003-10-21  7:30             ` Danek Duvall

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).