We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
stdin
I want to use async_std::io::std and terminal event after it. But the first event seems to be ignored. The procedure of reproduce is below:
async_std::io::std
use crossterm::event::{read, Event}; use crossterm::terminal; use std::time::Duration; fn main() { let buf = async_std::task::block_on(async_std::io::timeout(Duration::new(1, 0), async { use async_std::io::ReadExt; let mut buf = [0; 1]; let mut stdin = async_std::io::stdin(); let _ = stdin.read_exact(&mut buf).await?; Ok(buf) })); dbg!(buf); terminal::enable_raw_mode().unwrap(); println!("{:?}", read()); terminal::disable_raw_mode().unwrap(); }
dbg!
The expected result is that the first key pressing is shown. Actually the first key pressing is ignored, and the second key pressing is shown.
If let buf = ... code block is commented out, the first key pressing is shown.
let buf = ...
The text was updated successfully, but these errors were encountered:
This behaviour seems to be the same as tokio.
Sorry, something went wrong.
The behaviour seems to known limitation. I'll close this.
No branches or pull requests
I want to use
async_std::io::std
and terminal event after it.But the first event seems to be ignored.
The procedure of reproduce is below:
dbg!
message is shownThe expected result is that the first key pressing is shown.
Actually the first key pressing is ignored, and the second key pressing is shown.
If
let buf = ...
code block is commented out, the first key pressing is shown.The text was updated successfully, but these errors were encountered: