diff --git a/src/terminal.c b/src/terminal.c index 6cbe3433ff..f1b4313ad8 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3227,6 +3227,10 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED) { mch_check_messages(); parse_queued_messages(); + if (!buf_valid(buf)) + /* If the terminal is closed when the channel is closed the + * buffer disappears. */ + break; ui_delay(10L, FALSE); } mch_check_messages(); diff --git a/src/version.c b/src/version.c index 99007ac5c3..7e03c4b506 100644 --- a/src/version.c +++ b/src/version.c @@ -771,6 +771,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1317, /**/ 1316, /**/