aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/pty_process_unix.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/os/pty_process_unix.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/os/pty_process_unix.c')
-rw-r--r--src/nvim/os/pty_process_unix.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c
index 143f0b3900..cd2150a6a6 100644
--- a/src/nvim/os/pty_process_unix.c
+++ b/src/nvim/os/pty_process_unix.c
@@ -168,6 +168,14 @@ static struct termios termios_default;
/// @param tty_fd TTY file descriptor, or -1 if not in a terminal.
void pty_process_save_termios(int tty_fd)
{
+ if (embedded_mode) {
+ // TODO(bfredl): currently we cannot use the state of the host terminal in
+ // the server. when the TUI process launches the server, the state has already
+ // changed. we would need to serialize termios_default in the TUI process and
+ // transmit it. Altough, just always using the clean slate of init_termios() might
+ // be preferrable anyway.
+ return;
+ }
if (tty_fd == -1) {
return;
}