mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-27 06:22:20 +02:00
always print job status if non-zero status and PRINTEXITSVALUE
This commit is contained in:
parent
9a17762b0c
commit
5659426c2a
@ -1,5 +1,8 @@
|
||||
2010-07-31 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 28111: Src/jobs.c: always print exit status if PRINTEXITVALUE
|
||||
is set.
|
||||
|
||||
* users/15217: Src/Zle/zle_main.c: use top-level status
|
||||
when redrawing prompt.
|
||||
|
||||
@ -13457,5 +13460,5 @@
|
||||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5041 $
|
||||
* $Revision: 1.5042 $
|
||||
*****************************************************
|
||||
|
30
Src/jobs.c
30
Src/jobs.c
@ -837,7 +837,7 @@ printjob(Job jn, int lng, int synch)
|
||||
Process pn;
|
||||
int job, len = 9, sig, sflag = 0, llen;
|
||||
int conted = 0, lineleng = columns, skip = 0, doputnl = 0;
|
||||
int doneprint = 0;
|
||||
int doneprint = 0, skip_print = 0;
|
||||
FILE *fout = (synch == 2 || !shout) ? stdout : shout;
|
||||
|
||||
if (oldjobtab != NULL)
|
||||
@ -846,16 +846,7 @@ printjob(Job jn, int lng, int synch)
|
||||
job = jn - jobtab;
|
||||
|
||||
if (jn->stat & STAT_NOPRINT) {
|
||||
if (jn->stat & STAT_DONE) {
|
||||
deletejob(jn);
|
||||
if (job == curjob) {
|
||||
curjob = prevjob;
|
||||
prevjob = job;
|
||||
}
|
||||
if (job == prevjob)
|
||||
setprevjob();
|
||||
}
|
||||
return 0;
|
||||
skip_print = 1;
|
||||
}
|
||||
|
||||
if (lng < 0) {
|
||||
@ -889,11 +880,26 @@ printjob(Job jn, int lng, int synch)
|
||||
if (job == thisjob && sig == SIGTSTP)
|
||||
doputnl = 1;
|
||||
} else if (isset(PRINTEXITVALUE) && isset(SHINSTDIN) &&
|
||||
WEXITSTATUS(pn->status))
|
||||
WEXITSTATUS(pn->status)) {
|
||||
sflag = 1;
|
||||
skip_print = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (skip_print) {
|
||||
if (jn->stat & STAT_DONE) {
|
||||
deletejob(jn);
|
||||
if (job == curjob) {
|
||||
curjob = prevjob;
|
||||
prevjob = job;
|
||||
}
|
||||
if (job == prevjob)
|
||||
setprevjob();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* - Always print if called from jobs
|
||||
* - Otherwise, require MONITOR option ("jobbing") and some
|
||||
|
Loading…
Reference in New Issue
Block a user