diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-19 20:56:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-19 20:56:15 +0800 |
commit | 40287319002ff6ced3d280657c276fb7c9ef4df5 (patch) | |
tree | a092aa93434cc627b3cb48b5695246659c13191e | |
parent | c726585ce1a5a8776e747fe20bead0acec88edf4 (diff) | |
download | rneovim-40287319002ff6ced3d280657c276fb7c9ef4df5.tar.gz rneovim-40287319002ff6ced3d280657c276fb7c9ef4df5.tar.bz2 rneovim-40287319002ff6ced3d280657c276fb7c9ef4df5.zip |
fix(tui): properly check if stdin is a tty (#22321)
After #21831 `in_fd` is no longer set to stderr when starting TUI, so
check for `stdin_isatty` instead.
Fix #22259.
-rw-r--r-- | src/nvim/tui/tui.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 8df6e49b77..fee1d21672 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -1147,7 +1147,7 @@ void tui_mode_change(TUIData *tui, String mode, Integer mode_idx) // If stdin is not a TTY, the LHS of pipe may change the state of the TTY // after calling uv_tty_set_mode. So, set the mode of the TTY again here. // #13073 - if (tui->is_starting && tui->input.in_fd == STDERR_FILENO) { + if (tui->is_starting && !stdin_isatty) { int ret = uv_tty_set_mode(&tui->output_handle.tty, UV_TTY_MODE_NORMAL); if (ret) { ELOG("uv_tty_set_mode failed: %s", uv_strerror(ret)); |