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

A way to change the input stream for event::read and event::poll #728

Open
dmaahs2017 opened this issue Nov 11, 2022 · 4 comments
Open

A way to change the input stream for event::read and event::poll #728

dmaahs2017 opened this issue Nov 11, 2022 · 4 comments

Comments

@dmaahs2017
Copy link

dmaahs2017 commented Nov 11, 2022

Is your feature request related to a problem? Please describe.
I have an issue where my program uses a piped stdin, I want to manually open tty as a file and give that to crossterm for event handling though it does not seem possible at the moment. I also tried overriding stdin with the stdio_override crate which also did not work.

To clarify my use case - this was so that I could perform automated integration testing of my event handling implementation

Describe the solution you'd like
To be able to specify an input source for event::read and event::poll. Or a global override for the source of events.

Not sure if this is possible. Haven't had the chance to dive deep into the crossterm code yet.

@sigmaSd
Copy link
Contributor

sigmaSd commented Nov 12, 2022

Piped stdin is not supported currently #396
Pr that can fix this #711

@sigmaSd
Copy link
Contributor

sigmaSd commented Nov 12, 2022

Actually it works except on mac because it does seem to work on helix with linux (which uses crossterm)

@Narayanbhat166
Copy link

Hey @dmaahs2017, were you able to setup the testing framework using custom input source for stdin? I'm working on the same and any insights would be appreciated. Thanks.

@dmaahs2017
Copy link
Author

Hey @dmaahs2017, were you able to setup the testing framework using custom input source for stdin? I'm working on the same and any insights would be appreciated. Thanks.

IIRC I ended up giving up on this idea

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

No branches or pull requests

3 participants