aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-10-08 20:17:53 +0800
committerGitHub <noreply@github.com>2022-10-08 20:17:53 +0800
commitfad1022cafd971c59e28ba34ec58d4866d2d5297 (patch)
treeaaa1343d155be5798c9f585909a9ce1e0153eb96
parent2a12faaec18115bf057427834832ff20ccb3ffd4 (diff)
downloadrneovim-fad1022cafd971c59e28ba34ec58d4866d2d5297.tar.gz
rneovim-fad1022cafd971c59e28ba34ec58d4866d2d5297.tar.bz2
rneovim-fad1022cafd971c59e28ba34ec58d4866d2d5297.zip
fix(tui): resume main thread if suspending isn't implemented (#20523)
Not doing anything is better than hanging.
-rw-r--r--src/nvim/tui/tui.c5
1 files changed, 4 insertions, 1 deletions
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
}