aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r--src/nvim/os/input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index 486171b48a..5dcaee8304 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -8,6 +8,7 @@
#include "nvim/api/private/defs.h"
#include "nvim/os/input.h"
#include "nvim/os/event.h"
+#include "nvim/os/os.h"
#include "nvim/os/rstream_defs.h"
#include "nvim/os/rstream.h"
#include "nvim/ascii.h"
@@ -61,9 +62,14 @@ void input_start_stdin(int fd)
void input_stop_stdin(void)
{
if (!read_stream) {
+ // In some cases (i.e. "nvim && read") where we do not explicitly play with
+ // std{in,out,err}, some other module/library nevertheless sets the stream
+ // to non-blocking; we still must "fix" the stream (#2598) in those cases.
+ stream_set_blocking(global_input_fd, true); // normalize stream (#2598)
return;
}
+ rstream_set_blocking(read_stream, true); // normalize stream (#2598)
rstream_stop(read_stream);
rstream_free(read_stream);
read_stream = NULL;