Open
Description
Problem
Run the following code on Linux with console v0.15.7
:
use std::{thread, time::Duration};
fn main() {
println!("(This program will exit in 5 seconds.)");
println!("Press any key, and the program will echo the key you pressed.");
thread::spawn(|| {
let terminal = console::Term::stdout();
loop {
let key_pressed = terminal.read_char().unwrap(); // ← Blocking
println!("You pressed: {}", key_pressed);
}
});
thread::sleep(Duration::from_secs(5));
panic!("After the program exits, the terminal will stay in raw mode.")
}
After the program exits, the terminal will stay in raw mode. Anything I type in shell does not display on screen.
Related issues
Metadata
Metadata
Assignees
Labels
No labels