about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-06-26 08:18:22 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-06-26 08:18:22 +0000
commit2ca99605ed91b98eb100ebba5073cabff1ff9446 (patch)
treebe9fb9f06b106db1107ab01b31adbc005ab6447d /Src/jobs.c
parentb397a5187a61c42435ef3ade9cdfcb96b31822ee (diff)
downloadzsh-2ca99605ed91b98eb100ebba5073cabff1ff9446.tar.gz
zsh-2ca99605ed91b98eb100ebba5073cabff1ff9446.tar.xz
zsh-2ca99605ed91b98eb100ebba5073cabff1ff9446.zip
make warning message for disowning stopped jobs more verbose (saying how to make the job running again) (15087)
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 82e4926ff..50002d28f 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -1392,14 +1392,36 @@ bin_fg(char *name, char **argv, char *ops, int func)
 	    printjob(job + jobtab, lng, 2);
 	    break;
 	case BIN_DISOWN:
-	    if (jobtab[job].stat & STAT_STOPPED)
+	    if (jobtab[job].stat & STAT_STOPPED) {
+		char buf[20], *pids = "";
+
+		if (jobtab[job].stat & STAT_SUPERJOB) {
+		    Process pn;
+
+		    for (pn = jobtab[jobtab[job].other].procs; pn; pn = pn->next) {
+			sprintf(buf, " -%d", pn->pid);
+			pids = dyncat(pids, buf);
+		    }
+		    for (pn = jobtab[job].procs; pn->next; pn = pn->next) {
+			sprintf(buf, " %d", pn->pid);
+			pids = dyncat(pids, buf);
+		    }
+		    if (!jobtab[jobtab[job].other].procs && pn) {
+			sprintf(buf, " %d", pn->pid);
+			pids = dyncat(pids, buf);
+		    }
+		} else {
+		    sprintf(buf, " -%d", jobtab[job].gleader);
+		    pids = buf;
+		}
                 zwarnnam(name,
 #ifdef USE_SUSPENDED
-                         "warning: job is suspended",
+                         "warning: job is suspended, use `kill -CONT%s' to resume",
 #else
-                         "warning: job is stopped",
+                         "warning: job is stopped, use `kill -CONT%s' to resume",
 #endif
-                         NULL, 0);
+                         pids, 0);
+	    }
 	    deletejob(jobtab + job);
 	    break;
 	}