From eea32afdb83ae281a63152f7494f79ec7e45ff55 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 21 Nov 2021 14:51:13 +0000 Subject: patch 8.2.3640: freeze when calling term_wait() in a close callback Problem: Freeze when calling term_wait() in a close callback. Solution: Set a "closing" flag to tell term_wait() to return. (closes #9152) --- src/channel.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/channel.c') diff --git a/src/channel.c b/src/channel.c index b46205e675..7514d63855 100644 --- a/src/channel.c +++ b/src/channel.c @@ -3156,6 +3156,10 @@ channel_close(channel_T *channel, int invoke_close_cb) { ch_part_T part; +#ifdef FEAT_TERMINAL + // let the terminal know it is closing to avoid getting stuck + term_channel_closing(channel); +#endif // Invoke callbacks and flush buffers before the close callback. if (channel->ch_close_cb.cb_name != NULL) ch_log(channel, -- cgit v1.2.3