crossterm
crossterm copied to clipboard
A way to change the input stream for event::read and event::poll
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.
Piped stdin is not supported currently https://github.com/crossterm-rs/crossterm/issues/396 Pr that can fix this https://github.com/crossterm-rs/crossterm/pull/711
Actually it works except on mac because it does seem to work on helix with linux (which uses crossterm)
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.
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