aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/os.h3
-rw-r--r--src/nvim/os/pty_process_unix.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/os/os.h b/src/nvim/os/os.h
index bff2936f8e..a7496130cc 100644
--- a/src/nvim/os/os.h
+++ b/src/nvim/os/os.h
@@ -16,4 +16,7 @@
# include "os/users.h.generated.h"
#endif
+#define ENV_LOGFILE "NVIM_LOG_FILE"
+#define ENV_NVIM "NVIM"
+
#endif // NVIM_OS_OS_H
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c
index 4a49c0b162..c5d6af0ff6 100644
--- a/src/nvim/os/pty_process_unix.c
+++ b/src/nvim/os/pty_process_unix.c
@@ -163,10 +163,15 @@ 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)
{
- DLOG("tty_fd=%d", tty_fd);
- if (tty_fd == -1 || tcgetattr(tty_fd, &termios_default) != 0) {
+ 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