diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-01-09 14:09:01 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-01-10 14:04:58 +0100 |
commit | 38140a63fb255e7659c9a585bfbd32601a3f10f0 (patch) | |
tree | 9e359bf5b91d704e8245615d4bd79bd7fbd472a4 /src/nvim/os/pty_process_unix.c | |
parent | 87cfe50944ef2c84de98eb6b124fe312eef31313 (diff) | |
download | rneovim-38140a63fb255e7659c9a585bfbd32601a3f10f0.tar.gz rneovim-38140a63fb255e7659c9a585bfbd32601a3f10f0.tar.bz2 rneovim-38140a63fb255e7659c9a585bfbd32601a3f10f0.zip |
refactor(pty): remove old logic for inheriting termios from host terminal
Diffstat (limited to 'src/nvim/os/pty_process_unix.c')
-rw-r--r-- | src/nvim/os/pty_process_unix.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c index cd2150a6a6..2413f0339b 100644 --- a/src/nvim/os/pty_process_unix.c +++ b/src/nvim/os/pty_process_unix.c @@ -160,39 +160,13 @@ static pid_t forkpty(int *amaster, char *name, struct termios *termp, struct win #endif -/// termios saved at startup (for TUI) or initialized by pty_process_spawn(). -static struct termios termios_default; - -/// Saves the termios properties associated with `tty_fd`. -/// -/// @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; - } - int rv = tcgetattr(tty_fd, &termios_default); - if (rv != 0) { - ELOG("tcgetattr failed (tty_fd=%d): %s", tty_fd, strerror(errno)); - } else { - DLOG("tty_fd=%d", tty_fd); - } -} - /// @returns zero on success, or negative error code int pty_process_spawn(PtyProcess *ptyproc) FUNC_ATTR_NONNULL_ALL { + // termios initialized at first use + static struct termios termios_default; if (!termios_default.c_cflag) { - // TODO(jkeyes): We could pass NULL to forkpty() instead ... init_termios(&termios_default); } |