Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: No `you have running jobs.' message



On Nov 28,  1:52pm, Stefan Troeger wrote:
} Subject: No `you have running jobs.' message
}
} is it possible to turn of the `you have running jobs.' warning
} that pops up when exiting the shell while there are running
} background jobs and keep the `you have suspended jobs.' message?

No.  Suggested patch below; opinions from zsh-workers requested (please
follow-up to zsh-workers, not zsh-users).

The effect of this patch is that "setopt nohup" suppresses the "running
jobs" message.  Note that in 3.1.6-bart-8 and -pws-9, "unsetopt checkjobs"
suppresses both messages, no matter what the value of "nohup".

The change is smaller than the patch (lots of re-indented lines).

Index: Src/builtin.c
===================================================================
@@ -3159,22 +3159,25 @@
 {
     int i;
 
-    for (i = 1; i < MAXJOB; i++)
+    for (i = 1; i < MAXJOB; i++) {
 	if (i != thisjob && (jobtab[i].stat & STAT_LOCKED) &&
-	    !(jobtab[i].stat & STAT_NOPRINT))
-	    break;
-    if (i < MAXJOB) {
-	if (jobtab[i].stat & STAT_STOPPED) {
+	    !(jobtab[i].stat & STAT_NOPRINT)) {
+	    if (jobtab[i].stat & STAT_STOPPED) {
 
 #ifdef USE_SUSPENDED
-	    zerr("you have suspended jobs.", NULL, 0);
+		zerr("you have suspended jobs.", NULL, 0);
 #else
-	    zerr("you have stopped jobs.", NULL, 0);
+		zerr("you have stopped jobs.", NULL, 0);
 #endif
 
-	} else
-	    zerr("you have running jobs.", NULL, 0);
-	stopmsg = 1;
+		stopmsg = 1;
+	    } else if (isset(HUP)) {
+		zerr("you have running jobs.", NULL, 0);
+		stopmsg = 1;
+	    }
+	    if (stopmsg)
+		break;
+	}
     }
 }
 

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author