1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-09 19:51:26 +01:00

23141: don't zrfresh() after printjob() that didn't print

This commit is contained in:
Peter Stephenson 2007-01-30 19:03:45 +00:00
parent 2f6267dc31
commit a1476c1ee2
2 changed files with 20 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2007-01-27 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 23141: Src/jobs.c: don't refresh the display after
a printjob() that didn't print anything.
2007-01-29 Clint Adams <clint@zsh.org>
* 23140: Completion/Unix/Command/_arping: handle syntax for

View file

@ -448,8 +448,8 @@ update_job(Job jn)
curjob = job;
}
if ((isset(NOTIFY) || job == thisjob) && (jn->stat & STAT_LOCKED)) {
printjob(jn, !!isset(LONGLISTJOBS), 0);
if (zleactive)
if (printjob(jn, !!isset(LONGLISTJOBS), 0) &&
zleactive)
zrefreshptr();
}
if (sigtrapped[SIGCHLD] && job != thisjob)
@ -804,19 +804,22 @@ should_report_time(Job j)
* synch = 0 means asynchronous
* synch = 1 means synchronous
* synch = 2 means called synchronously from jobs
*
* Returns 1 if some output was done.
*/
/**/
void
int
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;
FILE *fout = (synch == 2) ? stdout : shout;
if (jn->stat & STAT_NOPRINT)
return;
return 0;
/*
* Wow, what a hack. Did I really write this? --- pws
@ -874,8 +877,10 @@ printjob(Job jn, int lng, int synch)
if (!synch)
trashzleptr();
if (doputnl && !synch)
if (doputnl && !synch) {
doneprint = 1;
putc('\n', fout);
}
for (pn = jn->procs; pn;) {
len2 = (thisfmt ? 5 : 10) + len; /* 2 spaces */
if (lng & 3)
@ -888,6 +893,7 @@ printjob(Job jn, int lng, int synch)
break;
len2 += strlen(qn->text) + 2;
}
doneprint = 1;
if (!thisfmt || lng) {
if (fline)
fprintf(fout, "[%ld] %c ",
@ -944,6 +950,7 @@ printjob(Job jn, int lng, int synch)
}
fflush(fout);
} else if (doputnl && interact && !synch) {
doneprint = 1;
putc('\n', fout);
fflush(fout);
}
@ -954,6 +961,7 @@ printjob(Job jn, int lng, int synch)
if ((lng & 4) || (interact && job == thisjob &&
jn->pwd && strcmp(jn->pwd, pwd))) {
doneprint = 1;
fprintf(fout, "(pwd %s: ", (lng & 4) ? "" : "now");
fprintdir(((lng & 4) && jn->pwd) ? jn->pwd : pwd, fout);
fprintf(fout, ")\n");
@ -973,6 +981,8 @@ printjob(Job jn, int lng, int synch)
setprevjob();
} else
jn->stat &= ~STAT_CHANGED;
return doneprint;
}
/**/