From 68eb063416b2436a25123c20bffdcd928ccfb22e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 7 Oct 2022 14:53:36 +0800 Subject: [PATCH] fix(tui): resume main thread if suspending isn't implemented Not doing anything is better than hanging. (cherry picked from commit 356332b4b2046ad0aded355a95dda9f934e26375) --- src/nvim/tui/tui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index b483ad3486..1cb1c34ad3 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1413,13 +1413,16 @@ static void suspend_event(void **argv) static void tui_suspend(UI *ui) { -#ifdef UNIX TUIData *data = ui->data; +#ifdef UNIX // kill(0, SIGTSTP) won't stop the UI thread, so we must poll for SIGCONT // before continuing. This is done in another callback to avoid // loop_poll_events recursion multiqueue_put_event(data->loop->fast_events, event_create(suspend_event, 1, ui)); +#else + // Resume the main thread as suspending isn't implemented. + CONTINUE(data->bridge); #endif }