aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/input.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-06-10 11:22:07 +0900
committerJustin M. Keyes <justinkz@gmail.com>2019-06-10 16:43:52 +0200
commitce90a19abd5ba0188454574ee7691d06a4534f8a (patch)
treed8ea5b2c9d43b8784033b2d1ba01880690a07360 /src/nvim/os/input.c
parent04e2ba85b1135a669f626ed59ceb2f797bc40997 (diff)
downloadrneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.tar.gz
rneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.tar.bz2
rneovim-ce90a19abd5ba0188454574ee7691d06a4534f8a.zip
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
Diffstat (limited to 'src/nvim/os/input.c')
-rw-r--r--src/nvim/os/input.c7
1 files changed, 6 insertions, 1 deletions
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);
}