aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ui_client.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-01-07 10:06:03 +0100
committerbfredl <bjorn.linse@gmail.com>2023-01-09 11:17:11 +0100
commit1d16bba4d8b8b648d2dabd610924bcf3051a0f29 (patch)
tree9ea37b95a190d055e37deabb3c556edd83bded70 /src/nvim/ui_client.c
parentc19bd47c0a2e3cc77d7f5e41ed184edb41685bd3 (diff)
downloadrneovim-1d16bba4d8b8b648d2dabd610924bcf3051a0f29.tar.gz
rneovim-1d16bba4d8b8b648d2dabd610924bcf3051a0f29.tar.bz2
rneovim-1d16bba4d8b8b648d2dabd610924bcf3051a0f29.zip
fix(embed): handle stdio in server properly
Rename stdin/stdout in the server, so that RPC data won't get corrupted. This also restores the use of stderr to write directly to the terminal.
Diffstat (limited to 'src/nvim/ui_client.c')
-rw-r--r--src/nvim/ui_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ui_client.c b/src/nvim/ui_client.c
index 2821054909..ff82fd3239 100644
--- a/src/nvim/ui_client.c
+++ b/src/nvim/ui_client.c
@@ -41,8 +41,11 @@ uint64_t ui_client_start_server(int argc, char **argv)
}
args[args_idx++] = NULL;
+ CallbackReader on_err = CALLBACK_READER_INIT;
+ on_err.fwd_err = true;
+
Channel *channel = channel_job_start(args, CALLBACK_READER_INIT,
- CALLBACK_READER_INIT, CALLBACK_NONE,
+ on_err, CALLBACK_NONE,
false, true, true, false, kChannelStdinPipe,
NULL, 0, 0, NULL, &exit_status);
if (ui_client_forward_stdin) {