tty
tty copied to clipboard
Should be able to use /dev/tty instead of stdin
I think the Stdin module should read from /dev/tty
instead of stdin (or else the user should be able to choose). Otherwise writing interactive programs that read input from stdin (e.g. fzf in cat ... | fzf
) will have problems.
Specifically, when I tried doing that with minttea, I got an ENOTTY error message (although the program still seemed to function as expected). Changing the stdin module to start with let stdin_fd = Unix.descr_of_in_channel (In_channel.open_bin "/dev/tty")
got rid of it.
Hi @roddyyaga! This makes perfect sense. Also would be kinda cool to "replay" by going cat file | tui
. Should I make the change or would you prefer opening a PR?
You can make the PR :)