Crates.io | tokio-terminal-resize |
lib.rs | tokio-terminal-resize |
version | 0.1.0 |
source | src |
created_at | 2019-10-27 19:37:08.392082 |
updated_at | 2019-10-27 19:37:08.392082 |
description | a stream of terminal resize events |
homepage | |
repository | https://git.tozt.net/tokio-terminal-resize |
max_upload_size | |
id | 176208 |
size | 7,100 |
Implements a stream of terminal resize events.
Whenever the user resizes their terminal, a notification is sent to the application running in it. This crate provides those notifications in the form of a stream.
let stream = tokio_terminal_resize::resizes().flatten_stream();
let prog = stream
.for_each(|(rows, cols)| {
println!("terminal is now {}x{}", cols, rows);
Ok(())
})
.map_err(|e| eprintln!("error: {}", e));
tokio::run(prog);