mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
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.
This commit is contained in:
@@ -279,6 +279,15 @@ int main(int argc, char **argv)
|
||||
// argument list "global_alist".
|
||||
command_line_scan(¶ms);
|
||||
|
||||
#ifndef MSWIN
|
||||
int tty_fd = params.input_isatty
|
||||
? STDIN_FILENO
|
||||
: (params.output_isatty
|
||||
? STDOUT_FILENO
|
||||
: (params.err_isatty ? STDERR_FILENO : -1));
|
||||
pty_process_save_termios(tty_fd);
|
||||
#endif
|
||||
|
||||
nlua_init(argv, argc, params.lua_arg0);
|
||||
TIME_MSG("init lua interpreter");
|
||||
|
||||
@@ -1455,14 +1464,6 @@ static void check_and_set_isatty(mparm_T *paramp)
|
||||
stdout_isatty
|
||||
= paramp->output_isatty = os_isatty(STDOUT_FILENO);
|
||||
paramp->err_isatty = os_isatty(STDERR_FILENO);
|
||||
#ifndef MSWIN
|
||||
int tty_fd = paramp->input_isatty
|
||||
? STDIN_FILENO
|
||||
: (paramp->output_isatty
|
||||
? STDOUT_FILENO
|
||||
: (paramp->err_isatty ? STDERR_FILENO : -1));
|
||||
pty_process_save_termios(tty_fd);
|
||||
#endif
|
||||
TIME_MSG("window checked");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user