mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
Merge pull request #21831 from bfredl/nofd
fix(ui): re-organize tty fd handling and fix issues
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user