From 36c0ec6dd49c8c1a57eaa0b9f9d3c44792582f37 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 2 Nov 2016 01:20:16 +0100 Subject: [PATCH] tui/suspend_event(): set STDIN to "blocking" Set STDIN to blocking on "suspend". This was missed in #2598. See 8a782f1699e2a59a3f3e91f6d7c35a3312b82b41. Also on "continue"/SIGCONT explicitly set STDIN back to NON-blocking. We don't explicitly do that on *startup* (libuv does it internally), but on "continue" it seems wise to restore libuv's expectations. Closes #5459 --- src/nvim/tui/tui.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index f252b00be2..5e30517c5a 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -611,6 +611,7 @@ static void suspend_event(void **argv) bool enable_mouse = data->mouse_enabled; tui_terminal_stop(ui); data->cont_received = false; + stream_set_blocking(input_global_fd(), true); // normalize stream (#2598) kill(0, SIGTSTP); while (!data->cont_received) { // poll the event loop until SIGCONT is received @@ -620,6 +621,7 @@ static void suspend_event(void **argv) if (enable_mouse) { tui_mouse_on(ui); } + stream_set_blocking(input_global_fd(), false); // libuv expects this // resume the main thread CONTINUE(data->bridge); }