summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2009-07-09 19:42:20 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2009-07-09 19:42:20 +0000
commitaa563b1a3fa01af1fb1d2036bdf769cbe1fa95d2 (patch)
tree8d2fa34320d3571989601b36395d532fda4d305f /Src
parentb31ca21b46ae445ca12ab0c89ad0d66e5426328b (diff)
downloadzsh-aa563b1a3fa01af1fb1d2036bdf769cbe1fa95d2.tar.gz
zsh-aa563b1a3fa01af1fb1d2036bdf769cbe1fa95d2.tar.xz
zsh-aa563b1a3fa01af1fb1d2036bdf769cbe1fa95d2.zip
27110: Only turn on MONITOR if set explicitly or INTERACTIVE
Diffstat (limited to 'Src')
-rw-r--r--Src/init.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/init.c b/Src/init.c
index 189451966..b0378ccfa 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -233,6 +233,11 @@ parseargs(char **argv)
      * be changed.  At the end of the function, a value of 2 gets        *
      * changed to 1.                                                     */
     opts[INTERACTIVE] = isatty(0) ? 2 : 0;
+    /*
+     * MONITOR is similar:  we initialise it to 2, and if it's
+     * still 2 at the end, we set it to the value of INTERACTIVE.
+     */
+    opts[MONITOR] = 2;   /* may be unset in init_io() */
     opts[SHINSTDIN] = 0;
     opts[SINGLECOMMAND] = 0;
 
@@ -343,6 +348,8 @@ parseargs(char **argv)
     if(isset(SINGLECOMMAND))
 	opts[INTERACTIVE] &= 1;
     opts[INTERACTIVE] = !!opts[INTERACTIVE];
+    if (opts[MONITOR] == 2)
+	opts[MONITOR] = opts[INTERACTIVE];
     pparams = x = (char **) zshcalloc((countlinknodes(paramlist) + 1) * sizeof(char *));
 
     while ((*x++ = (char *)getlinknode(paramlist)));
@@ -1395,7 +1402,6 @@ zsh_main(UNUSED(int argc), char **argv)
     createoptiontable();
     emulate(zsh_name, 1);   /* initialises most options */
     opts[LOGINSHELL] = (**argv == '-');
-    opts[MONITOR] = 1;   /* may be unset in init_io() */
     opts[PRIVILEGED] = (getuid() != geteuid() || getgid() != getegid());
     opts[USEZLE] = 1;   /* may be unset in init_io() */
     parseargs(argv);   /* sets INTERACTIVE, SHINSTDIN and SINGLECOMMAND */