tty icon indicating copy to clipboard operation
tty copied to clipboard

Should be able to use /dev/tty instead of stdin

Open roddyyaga opened this issue 1 year ago • 2 comments

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.

roddyyaga avatar Dec 21 '23 14:12 roddyyaga

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?

leostera avatar Dec 22 '23 05:12 leostera

You can make the PR :)

roddyyaga avatar Dec 24 '23 14:12 roddyyaga