summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-03-08 18:18:05 +0000
committerPeter Stephenson <pws@zsh.org>2016-03-09 09:51:14 +0000
commitf4dfca490cb6d4b4fc7c6b977db56ab0d718de21 (patch)
treee1ea3ede38fa0a02cfeeb5dbbca64fccf3441eda /Src
parent4b6a79887d7db0ea126435095b7fdcd357aa2540 (diff)
downloadzsh-f4dfca490cb6d4b4fc7c6b977db56ab0d718de21.tar.gz
zsh-f4dfca490cb6d4b4fc7c6b977db56ab0d718de21.tar.xz
zsh-f4dfca490cb6d4b4fc7c6b977db56ab0d718de21.zip
38114: Fix hang using ^Z with command subst.
In subshells started to perform substitutions disable signals
that require interactive handling.
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c
index b60fc90bd..50eff72cb 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -994,9 +994,18 @@ entersubsh(int flags)
     if ((flags & ESUB_REVERTPGRP) && getpid() == mypgrp)
 	release_pgrp();
     shout = NULL;
-    if (!job_control_ok) {
+    if (flags & ESUB_NOMONITOR) {
 	/*
-	 * If this process is not goign to be doing job control,
+	 * Allowing any form of interactive signalling here is
+	 * actively harmful as we are in a context where there is no
+	 * control over the process.
+	 */
+	signal_ignore(SIGTTOU);
+	signal_ignore(SIGTTIN);
+	signal_ignore(SIGTSTP);
+    } else if (!job_control_ok) {
+	/*
+	 * If this process is not going to be doing job control,
 	 * we don't want to do special things with the corresponding
 	 * signals.  If it is, we need to keep the special behaviour:
 	 * see note about attachtty() above.