mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
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:
11
server.c
11
server.c
@ -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;
|
||||
|
Reference in New Issue
Block a user