into_raw_mode() should not assume stdin is TTY
Created by: uasi
Currently termion::raw::IntoRawMode::into_raw_mode()
and its underlying function termion::termios::get_terminal_attr()
assumes stdin is tied to TTY[1] but it is not always the case. For example, interactive filtering tool such as peco and fzf reads file piped to stdin while accepting key input via /dev/tty
.
[1] https://github.com/ticki/termion/blob/3c123df1febb7a768add9ecdb2baf733c5a5c9a0/src/termios.rs#L21