summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-07-29 15:53:39 +0200
committerBram Moolenaar <Bram@vim.org>2017-07-29 15:53:39 +0200
commit1e8340bbbfb26d170a3f8b135dcb874e90a74e0b (patch)
tree1e8fb746031ea5e09880e8dfa992257ade6bfdac /src/terminal.c
parent696d00f488dc0599692993f226a7dd95a187920d (diff)
downloadvim-git-1e8340bbbfb26d170a3f8b135dcb874e90a74e0b.tar.gz
patch 8.0.0801: terminal window title says "running" after job exitsv8.0.0801
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.
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index b68081f31..d02e7f12c 100644
--- 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);
}
/*