changeset 11842:6bfcedcc0262 v8.0.0801

patch 8.0.0801: terminal window title says "running" after job exits commit https://github.com/vim/vim/commit/1e8340bbbfb26d170a3f8b135dcb874e90a74e0b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 29 15:53:39 2017 +0200 patch 8.0.0801: terminal window title says "running" after job exits 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 29 Jul 2017 16:00:04 +0200
parents b0a9c124b737
children 94f7feb4ddcb
files src/terminal.c src/version.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -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);
 }
 
 /*
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    801,
+/**/
     800,
 /**/
     799,