diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-06-26 08:18:22 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-06-26 08:18:22 +0000 |
commit | 2ca99605ed91b98eb100ebba5073cabff1ff9446 (patch) | |
tree | be9fb9f06b106db1107ab01b31adbc005ab6447d /Src/jobs.c | |
parent | b397a5187a61c42435ef3ade9cdfcb96b31822ee (diff) | |
download | zsh-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.c | 30 |
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; } |