If a #() command doesn't exit, use its most recent line of output (it

must be a full line). Don't let it redraw the status line more than once
a second.

Requested by someone about 10 years ago...
This commit is contained in:
nicm
2017-04-20 09:20:22 +00:00
parent f184c6f06c
commit 0b44ad99b5
9 changed files with 106 additions and 46 deletions

View File

@ -134,7 +134,8 @@ server_create_socket(void)
int
server_start(struct event_base *base, int lockfd, char *lockfile)
{
int pair[2];
int pair[2];
struct job *job;
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0)
fatal("socketpair failed");
@ -180,6 +181,12 @@ server_start(struct event_base *base, int lockfd, char *lockfile)
server_add_accept(0);
proc_loop(server_proc, server_loop);
LIST_FOREACH(job, &all_jobs, entry) {
if (job->pid != -1)
kill(job->pid, SIGTERM);
}
status_prompt_save_history();
exit(0);
}
@ -400,7 +407,7 @@ server_child_exited(pid_t pid, int status)
}
}
LIST_FOREACH(job, &all_jobs, lentry) {
LIST_FOREACH(job, &all_jobs, entry) {
if (pid == job->pid) {
job_died(job, status); /* might free job */
break;