tokio-terminal-resize

Crates.iotokio-terminal-resize
lib.rstokio-terminal-resize
version0.1.0
sourcesrc
created_at2019-10-27 19:37:08.392082
updated_at2019-10-27 19:37:08.392082
descriptiona stream of terminal resize events
homepage
repositoryhttps://git.tozt.net/tokio-terminal-resize
max_upload_size
id176208
size7,100
Jesse Luehrs (doy)

documentation

README

tokio-terminal-resize

Implements a stream of terminal resize events.

Overview

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.

Synopsis

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);
Commit count: 0

cargo fmt