Skip to content

Commit 1e8340b

Browse files
committed
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.
1 parent 696d00f commit 1e8340b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/terminal.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ term_convert_key(int c, char *buf)
491491
static int
492492
term_job_running(term_T *term)
493493
{
494-
return term->tl_job != NULL && term->tl_job->jv_status == JOB_STARTED;
494+
/* Also consider the job finished when the channel is closed, to avoid a
495+
* race condition when updating the title. */
496+
return term->tl_job != NULL
497+
&& term->tl_job->jv_status == JOB_STARTED
498+
&& channel_is_open(term->tl_job->jv_channel);
495499
}
496500

497501
/*

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
801,
772774
/**/
773775
800,
774776
/**/

0 commit comments

Comments
 (0)