diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-01-16 11:55:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 11:55:34 +0100 |
commit | 90493beb1584b9a99d3a71658bccd536d601e0f7 (patch) | |
tree | 67700bd213d699b0c5116ca5b6f5078afd6f8246 /src/nvim/ui_client.c | |
parent | 2773685c1df8cfe6cdc7bfc29836641cadeb0726 (diff) | |
parent | 160c69b655ce2e47fbedcc87fcb4949c2bc04dce (diff) | |
download | rneovim-90493beb1584b9a99d3a71658bccd536d601e0f7.tar.gz rneovim-90493beb1584b9a99d3a71658bccd536d601e0f7.tar.bz2 rneovim-90493beb1584b9a99d3a71658bccd536d601e0f7.zip |
Merge pull request #21831 from bfredl/nofd
fix(ui): re-organize tty fd handling and fix issues
Diffstat (limited to 'src/nvim/ui_client.c')
-rw-r--r-- | src/nvim/ui_client.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c index b80b250cec..222ba3d5dd 100644 --- a/src/nvim/ui_client.c +++ b/src/nvim/ui_client.c @@ -51,9 +51,16 @@ uint64_t ui_client_start_server(int argc, char **argv) on_err, CALLBACK_NONE, false, true, true, false, kChannelStdinPipe, NULL, 0, 0, NULL, &exit_status); + + // If stdin is not a pty, it is forwarded to the client. + // Replace stdin in the TUI process with the tty fd. if (ui_client_forward_stdin) { close(0); - dup(2); +#ifdef MSWIN + os_open_conin_fd(); +#else + dup(stderr_isatty ? STDERR_FILENO : STDOUT_FILENO); +#endif } return channel->id; |