#terminal-size #terminal #size #sigwinch

tokio-terminal-resize

a stream of terminal resize events

1 unstable release

0.1.0 Oct 27, 2019

#17 in #terminal-size

Download history 8/week @ 2024-02-19 22/week @ 2024-02-26 11/week @ 2024-03-04 13/week @ 2024-03-11

54 downloads per month
Used in 2 crates

MIT license

6KB
82 lines

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);

lib.rs:

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);

Dependencies

~8MB
~136K SLoC