Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
roddyyaga opened this issue Dec 21, 2023 · 2 comments
Open

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

roddyyaga opened this issue Dec 21, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@roddyyaga
Copy link

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.

@leostera leostera added the enhancement New feature or request label Dec 22, 2023
@leostera
Copy link
Member

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?

@roddyyaga
Copy link
Author

You can make the PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants