]> granicus.if.org Git - vim/commitdiff
patch 8.0.0801: terminal window title says "running" after job exits v8.0.0801
authorBram Moolenaar <Bram@vim.org>
Sat, 29 Jul 2017 13:53:39 +0000 (15:53 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 29 Jul 2017 13:53:39 +0000 (15:53 +0200)
Problem:    The terminal window title sometimes still says "running" even
            though the job has finished.
Solution:   Also consider the job finished when the channel has been closed.

src/terminal.c
src/version.c

index b68081f314aadbaf87c25198141463d94c02134d..d02e7f12c4bb649ee4697f0a581440de7f2d2f16 100644 (file)
@@ -491,7 +491,11 @@ term_convert_key(int c, char *buf)
     static int
 term_job_running(term_T *term)
 {
-    return term->tl_job != NULL && term->tl_job->jv_status == JOB_STARTED;
+    /* Also consider the job finished when the channel is closed, to avoid a
+     * race condition when updating the title. */
+    return term->tl_job != NULL
+       && term->tl_job->jv_status == JOB_STARTED
+       && channel_is_open(term->tl_job->jv_channel);
 }
 
 /*
index a44e5505b9971715089ec26067584d295cce4b3a..4c2a48ad374c01773c803496537df7186f9d0cfb 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    801,
 /**/
     800,
 /**/