From ce90a19abd5ba0188454574ee7691d06a4534f8a Mon Sep 17 00:00:00 2001 From: erw7 Date: Mon, 10 Jun 2019 11:22:07 +0900 Subject: TUI: set os/input.c:global_fd to input->in_fd #10174 Problem: When we changed startup to wait for the TUI (like a remote UI), we forgot to set os/input.c:global_fd. That used to be done by input_start(). Solution: Initialize os/input.c:global_fd before initializing libtermkey (termkey_new_abstract) so that tui_get_stty_erase() and friends can inspect the correct fd. fixes #10134 close #10174 --- src/nvim/os/input.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/nvim/os') diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c index 8070f4c420..5d43dff5c1 100644 --- a/src/nvim/os/input.c +++ b/src/nvim/os/input.c @@ -50,6 +50,11 @@ void input_init(void) input_buffer = rbuffer_new(INPUT_BUFFER_SIZE + MAX_KEY_CODE_LEN); } +void input_global_fd_init(int fd) +{ + global_fd = fd; +} + /// Global TTY (or pipe for "-es") input stream, before UI starts. int input_global_fd(void) { @@ -62,7 +67,7 @@ void input_start(int fd) return; } - global_fd = fd; + input_global_fd_init(fd); rstream_init_fd(&main_loop, &read_stream, fd, READ_BUFFER_SIZE); rstream_start(&read_stream, input_read_cb, NULL); } -- cgit